while within while

S

Shawn Minisall

K I've since fixed the UnboundLocalError: local variable 'ai' referenced
before assignment error, I forgot to include decision = (1, 2, 3) inside
" " for each number.

Now when I run it, I get this..
READY TO PLAY ROCK, PAPER, SCISSORS???

Please choose from the following menu:
1. See the rules
2. Play against the computer
3. Play a two player game
4. Exit
Please enter your choice here: 2

=====================
you choose scissors

I choose

YOU LOSE!

Rounds Won: 0

Rounds Lost: 1

Rounds Tied: 0


Would you like to play again? y
Please choose from the following menu:
1. See the rules
2. Play against the computer
3. Play a two player game
4. Exit
Please enter your choice here: 2

Please choose a weapon from the following menu:
1. Rock
2. Paper
3. Scissors
Please choose a weapon: 1

and then the weapon submenu repeats over and over.

It's also like the program is ignoring

if ai == "1":
ai = "rock"
if ai == "2":
ai = "paper"
if ai == "3":
ai = "scissors"

since it says I choose ________
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top