0

My assignment for python is to create a card game where 2-3 draw 3 random cards in order to try to get a total of 31. If there are three identical cards(ex player has 3 2's). That value is equal to 30. At any point does a player get 31, the game is over. The game is four rounds and players have option from taking card from deck or discard pile. I am pretty new to python and it is giving me some issues. So far i have the menu created and the deck can randomly hand out three cards from the deck. I used the ranges [0:3] for player 1, [3:6] for player 2 and [6:9] player 3...hence the ranges from the card deck would be given to the players and those cards are printed. However i have three concerns that keep on bugging me. 1. I am having an issue giving values to each card, ex assinging FaceCards=10 Aces=11 and cards 2-10 to their number values. 2) I am having an issue getting the game going, for instance, once the players are given out I don't know how i could code it so the player has the option of choosing the card from the discard pile and deck...and if they choose either one...how i would be able to add that string to their hand and subtract a card they don't want. 3) If a player decides to choose from the discard pile...how would I be able to make the discarded card from the hand the new discarded card in the discard pile? Any help is greatly appreciated!

2
Contributors
1
Reply
3
Views
5 Years
Discussion Span
Last Post by woooee
0

1. I am having an issue giving values to each card, ex assinging FaceCards=10 Aces=11 and cards 2-10 to their number values.

What is in the card deck? Are they 1-52, in which case every group of 13 would be a suit, so 1=2 Clubs, 14=2 Diamonds, etc. or are they something like "2C", "2D"? Post the code you have so far.

2) I am having an issue getting the game going, for instance, once the players are given out I don't know how i could code it so the player has the option of choosing the card from the discard pile and deck...and if they choose either one...how i would be able to add that string to their hand and subtract a card they don't want

I would assume that you would ask for one of 3 options
1. discard pile
2. deck
3. no additional cards
and then a random choice if 1 or 2.

how i would be able to add that string to their hand and subtract a card they don't want

No idea as we don't know how you store the "hand".

Edited by woooee: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.