updating score in card game
Posted
by
Confused
on Stack Overflow
See other posts from Stack Overflow
or by Confused
Published on 2011-03-30T03:39:32Z
Indexed on
2012/10/08
3:37 UTC
Read the original article
Hit count: 510
python
|playing-cards
I am a total beginner with python.
I need help updating the score of a card game.
The scoring works as follows:
Player A or B has a pair: score += 1
Player A asks Player B (vice versa) for a card and that player has it: score += 1
Player B doesn't have it, Player A has to draw a card. If there is pair after draw: score += 2
I have the logic down but I don't really know how to connect it together.
I tried manually adding the scores in my functions, but it get's messy and complicated :(
I assume I would have to make a new function for the score and call them in my other functions?
I would appreciate the guidance,
Thank-you!
© Stack Overflow or respective owner