Card Game – Where the aim is to get your cards closer to 21 than the dealer, while not going over. J, Q, K are worth 10. A are either 11 or 1.
Questions tagged [blackjack]
464 questions
-2
votes
1 answer
main method won't run while loop in java
Hello I am writing a file in java that allows the user to play blackjack against the computer. Below is my code. Whenever i run it inside Dr.javait says running main method however nothing happens. I know if you don't give a while a loop a condition…
-2
votes
1 answer
The value of my integers is not showing in my black jack program c#
I am trying to complete a very simple black jack program. What I seem to having trouble with is the fact that there are no numbers being generated for card one and two. This is my code so far:
namespace Black_Jack
{
class Program
{
static void…

Thatonepeep
- 17
- 2
-2
votes
1 answer
{close} CAN't use the Object. Reason: haven't had a place to store the player
I do the first part but the playeri can't use in the second part
because I forget to create an array to store it:
Player[] player = new Player[11];//solution add a array to store the player
for(int i=1;i<=10;i++) {
boolean finishplayeri =…

kit
- 1
- 3
-2
votes
1 answer
Python; NameError: name 'handsum' is not defined
I am coding a basic BlackJack game, and I challenged myself to make as many functions as possible, so that the code looks like this:
funcA()
funcB()
funcC()
As opposed to:
funcA()
print("this")
print("that")
funcB()
Here is where my problem is in…
-2
votes
1 answer
I don't know how to add integers and print them in my blackjack game, C
I'm almost done with my blackjack game but I have problem with adding the cards integers. As you can see I print the cards and the value of card one is shown, the second value is the sum of both cards. I just want to print the sum but for some…

Mallom
- 47
- 1
- 6
-2
votes
1 answer
Java BlackJack game using OOP
This is my Deck class:
import java.util.Random;
public class Deck
{
private Card[] myCards;
private int numCards;
// This constructor builds a deck of 52 cards.
public Deck()
{
int c = 0;
this.numCards = 52;
…

SolidSpectre
- 1
- 1
- 3
-2
votes
2 answers
Why is my call to the shuffle method not working?
I am making a blackjack game that requires the deck to be shuffled at the beginning of each iteration. The two classes of importance here are Deck and Game. In Deck, I created an ArrayList called deck to hold the 52 cards. I also created a method…

Joe Smith
- 9
- 1
-2
votes
2 answers
Python - Blackjack
def showCards():
#SUM
sum = playerCards[0] + playerCards[1]
#Print cards
print "Player's Hand: " + str(playerCards) + " : " + "sum"
print "Dealer's Hand: " + str(compCards[0]) + " : " + "sum"
compCards = [Deal(),Deal()] …

user377419
- 4,681
- 13
- 42
- 56
-2
votes
3 answers
C# BlackJack - same card dealt to player & cpu?
i'm working on a little black jack game for no apparent reason, and I've run into an issue and i can't figure out where i'm going wrong, the only thing i can imagine is that the 'new card' method is being called twice, too quickly...
The problem is…

JustBenji
- 73
- 6
-2
votes
3 answers
Cannot get my blackjack program to print a shuffled version of a deck
I've recently started trying to teach myself some basic Java. One of the first projects that I decided to work on was a simple blackjack program. I was creating a few basic structures for the game (I haven't done anything with the actual game…

Bryce Morrow
- 101
- 1
- 8
-2
votes
2 answers
BlackJack Java: Hand Print Error
I have a hand class that has a number of cards. The dealer deals a card to my hand and I want my game to display the cards that the user currently has. Here is the game code where in my GameEngine class I print out the cards in the hand. The problem…

DarkZal
- 23
- 6
-2
votes
3 answers
Blackjack Program, No Idea Where to Start
So I have a programming assignment to create a blackjack program. All I need to do is create the methods for it for the class BlackJackHand. Im pretty lost. Are my variables I have so far correct? Here is BlackJackHand:
package blackjack;
public…

Lucas Clarke
- 21
- 1
- 1
- 7
-2
votes
1 answer
BlackJack Java Code Testing
I am having a problem testing blackjack java code, this is the following code:
package view;
/*
////In this applet, the user plays a game of Blackjack. The
////computer acts as the dealer. The user plays by clicking
////"Hit!" and "Stand!"…

user1279780
- 99
- 3
- 10
-3
votes
2 answers
How do you see if a value is greater than two others? ex: a=5, b=9, c=1: if a > b & c: print("~~~")
I have been trying to make a black jack game, and have come to a point where three players roll the dice to decide who goes first. I need to check if player_a rolled higher than both player_b & player_c. I tried: if a_roll > b_roll & c_roll:, but…

MGG3500
- 1
- 2
-3
votes
1 answer
Blackjack game - Difficulty with Java - superclasses
I'm creating a Blackjack program and I'm stuck, I would appreciate any help available.
I have a Player class and a Card class.
The below function (getHandValue) is meant to calculate the total value of the player's hand.
/*getHandValue - accessor…

bi8921
- 1