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
dict object is not callable - Python 3
i'm writing a Blackjack code and this what I currently have:
values = {'Two': 2, 'Three': 3, 'Four': 4, 'Five': 5, 'Six': 6, 'Seven': 7, 'Eight': 8, 'Nine': 9, 'Ten': 10,
'Jack': 10, 'Queen': 10, 'King': 10, 'Ace': 11}
class Hand:
#…

nehry
- 45
- 1
- 2
- 8
2
votes
2 answers
How to push an object into array and then call parts of object in that array
I'm making a blackjack game in Javascript which requires making objects for each card so that multiple cards equal 10. I'm then calling a random number and pushing the corresponding card into the array dealerArr, my problem is when I want to add the…

Leo
- 115
- 1
- 10
2
votes
0 answers
Unity and Visual Studio - Issues with a button not working
So I downloaded the assets file of the final version of the Sloan Kelly Card Game Project from YouTube Link to the video where you can download it in the description and I was playing around with the game it was all working fine.
I then re-opened…

HAllen
- 15
- 2
2
votes
1 answer
Python: Square Brackets Inside of Parentheses
I saw square bracketed arguments inside of parentheses. I don't know what it means and how it differs from a normal argument, so I am hoping for some enlightenment on this matter.
Here are the code lines in question:
(I'll print the whole block…

Viktor
- 29
- 4
2
votes
3 answers
Data structures for a Blackjack game
I'm trying to learn how to use Ruby and as my first application I'd like to build a console based Blackjack game.
I'm not too familiar with the Ruby constructs and the only way I'll learn and feel at home is build things and learn from my…
delete
2
votes
3 answers
Assigning int value to string
I'm designing a Black Jack program. My issue is that, I use a switch case to generate a random card. But when it comes time to compare the value of the cards....lets say if(pCard1 + pCard2 > 21) it's not allowing me to compare them because they are…

PizzaParrot
- 121
- 8
2
votes
5 answers
How to have a method pause and wait for input with Android?
Basically I have created a Blackjack app that uses several methods that get called and pass a long the information that is needed (about cards and actions). I have 2 buttons displayed on screen that are click able (hit and stand). Now I have a…

Ivan S
- 1,051
- 6
- 14
- 26
2
votes
2 answers
Python Blackjack Count
Not so much a problem or question, just wanted to know how other people would approach this. I'm working in python to make a blackjack game through python's class structure and I've made the deck an array with the cards as strings. This helps with…

Trotaner
- 21
- 1
- 2
2
votes
2 answers
How do I create a blackjack game as a simulation between two players?
I've been struggling to figure out how to convert this program into one between two players instead of just the dealer and me. Is it supposed to loop somehow, giving the first iteration of the loop to player 1 and than the other to player 2? I'm…

Nitsuga Arashi
- 47
- 1
- 8
2
votes
2 answers
Python: How do you make 2 values in two different functions equal?
So I'm trying to program a blackjack game in Python by using randomed dice and I was trying to compare the player function to the dealer function, but I don't know how to make one function compared to the other? If you could explain how I could make…

CoTaNgO
- 67
- 1
- 8
2
votes
1 answer
Java GridLayout: south-JPanel covers center-JPanel?
I'm currently working on my first real blackJack program. It's nearly finished, but i've ran into a major problem.
When I run the code, it displays the players card in the center JPanel, as planned. But once I'm done and press to end the turn, only…

Jojo
- 61
- 7
2
votes
2 answers
Adding two functions together to make one value?
Hello amazing people of StackOverflow,
I am trying to make a blackjack game using javascript. In my code I have two functions. These functions deal out a first card value when "deal" has been pressed and deals…

hainerboy
- 35
- 4
2
votes
1 answer
Count number of Blackjack's that occur in 100 2-card deals
I need to count the number of times Blackjack occurs in 100 2-card deals from a 5 deck shoe. So far I have this:
str() - convert to string
def str(draw):
suits = {
'S':'Spades',
'H':'Hearts',
'D':'Diamonds',
…

jwp0025
- 31
- 1
- 7
2
votes
0 answers
Blackjack program class organization c++ OOP best practices
I wrote a blackjack program and this question is more about the design / organization than a coding error. (is that allowed?)
I created a playing card class and then created a vector of 52 playing cards as my deck. I created some basic functions…

Csw
- 105
- 1
- 8
2
votes
1 answer
Python - For loop isn't kicking in (blackjack game)
I'm just starting to learn python and my first project is a text based Blackjack game.
pHand being the players hand and pTotal being the total of the players cards.
The for loop seems to be exiting after the first iteration. When I print pTotal and…
user4966102