Hey guys, for line 29 and 31 isn’t working for me. Can you help me out? Link to my code
What is the purpose of this and other similar lines of code that assign to a variable the same value that it already has?:
player1_wins = player1_wins
It seems that instead you should be incrementing the value of the variable.
Thx, I’ve realized my mistake
There are other issues that need to be addressed as well. One of them is that in this line, you check the value of
player2_wins but not the value of
while player2_wins != 3 and rounds != 10:
For that line of code, it shows that there should be at least 3 round and up to 10. Heres my new code
In your new code, you have some confusing names of variables:
user1_input_input_wins = 0 user2_input_wins = 0
Ya, I just noticed that, thx for letting me know
Also, this collects input from users without prompting them:
player1 = input() player2 = input()
You could do this instead so that it becomes more obvious which player’s turn it is to supply input:
player1 = input("Player 1: ") player2 = input("Player 2: ")
Thx so much, It less confusing now
Continue to check your program to make sure it works as you intended it. For example, enter a series of responses that should produce a winning game for each player, and a series that produces a tie game. Let us know how it works out. Thorough debugging should check a representative variety of different cases.
Ok, I will show it to you after I’m done
Thanks. We look forward to seeing the result.
Hey, when I input
Its not working, The expected output is Player1 wins after 4 rounds!
The first of your inputs is an uppercase
P. That would be invalid input, since it should be lowercase.
nope, it still doesn’t work, Here’s my latest work
This line can cause a problem:
while user2_wins != 3 and rounds != 10:
When Player2 has scored 3 wins, the game ends. However, when Player1 scores 3 wins, it does not end the game. Why is it different for the two players?
This is what I’ve changed so far, now we got another problem
when I input
p p p r r r s s p p s s s s p p r p s p
Its not working
Instead of this:
while user1_wins != 3 and user2_wins != 10:
… you probably should have this:
while user1_wins != 3 and user2_wins != 3 and rounds != 10:
Thx, I have changed it, we got another problem when I input p p s s r r r s s r p s r p , the output shows Player1 wins after 6 rounds . The expected output is Player2 wins after 7 rounds!
Could we have a link to the most recent version of the game?