Randint is just repeating itself [Solved]

I am making my self a game as a side project to use as extra study along side LPTHW .

It is a “rock, scissor, paper” game. 1 player vs computer.
First to get 5 points win the game
I have just made the basic part to work more or less as I wanted.
Except for one thing I just noticed.
If I win one go (rock - scissor). I can continue to repeat my last input (rock) until I will win the game.
For some reason randint(1,3) does not change value.
I got my code at Gighub:
rock_bag.py (found out the english name after I created the file)

I think I get a random value from game the first go.
And if I dont repeat my last input the game will give another value.
How can I get randint to “refresh” everytime?

I will build up more functionality as I learn more.

I think you commented out the line that gets a new rock:

But, you could also use a different function:

https://docs.python.org/3/library/random.html#random.choice

Hello @zedshaw.

Thanks for help.
I had to put it below “while True:” to get random values.
Now it works fine. I will continue working on this file with things I have learned in LPTHW.
I will also try the other solution you suggested.

1 Like