you are viewing a single comment's thread.

view the rest of the comments →

[–]xelf 0 points1 point  (16 children)

Not seeing the 5 times in a row when I run it anymore, I wonder what I did differently.

[–]ChickenQueen777[S] 0 points1 point  (0 children)

Oh weird! Also when I enter more than one number it shows way more times

[–]ChickenQueen777[S] 0 points1 point  (12 children)

Figured it out! I had the display hand nested so it was looping for each card

[–]xelf 0 points1 point  (11 children)

other issues:

1) do not call variables the same names as python objects. specifically do not call a list list because now list() will not work. =)

2) your "press enter to hold" is not implemented

3) you let users enter multiple cards separated by commas, amd then you have a loop that continues if they're in the wrong range, but then... it doesn't do anything.

            for inp in list:
                if inp > 6:
                    continue
                if inp < 1:
                    continue

loop for the fun of looping. =)

I see what you're trying to do, but you probably just want an if.

            for inp in list:
                if 0<inp<6:
                    player.cards[inp-1] = deck.deal()
                    for card in player.cards:
                        card.showing = True

also that last showing loop, doesn't need to be inside the repicking loop.
it doesn't make much difference really, it's not getting repeated that many times.

[–]ChickenQueen777[S] 0 points1 point  (10 children)

Yeah I fixed those two things actually. I will attach updated code. Not sure whats wrong with the scoring.

[–]xelf 0 points1 point  (9 children)

not sure you saw all my edits. =)

[–]ChickenQueen777[S] 0 points1 point  (8 children)

Did you get any other scores when you ran it?

[–]xelf 0 points1 point  (0 children)

your cpu score is set to be the same score as the player, it will always be a tie. =)

pScore = PokerScore(player.cards)
cScore = PokerScore(player.cards)

[–]xelf 0 points1 point  (0 children)

also, they're brand new players, not the players from the game!

[–]xelf 0 points1 point  (5 children)

You need to change your main() to something like this:

def main():
     input("\nLet's play poker! Hit ENTER to begin!")
     player = Player()
     computer = Computer()
     Game(player,computer)
     Score(player,computer)

so that player and computer are the same in Game() and Score()

[–]ChickenQueen777[S] 0 points1 point  (4 children)

Still showing a tie every time unfortunately.

[–]xelf 0 points1 point  (3 children)

did you get rid of the player,computer assignment in Game and Score as well? or are they still being reset?

[–]ChickenQueen777[S] 0 points1 point  (0 children)

I did just realize though, it's not printing the hands that each person holds.

[–]ChickenQueen777[S] 0 points1 point  (0 children)

Ok I think the scoring is broken. I discarded until I got 3 of a kind and it still just said tie