Challenge
No
Write a program to play the game rock, paper, scissors. Make sure the game wins every turn.
Here's some I/O:
Rock, paper, scissors
=====================
Rock (r), paper (p), or scissors (s) (Q to quit)? something
Please type r, p, s, or q.
Rock (r), paper (p), or scissors (s) (Q to quit)?
Please type r, p, s, or q.
Rock (r), paper (p), or scissors (s) (Q to quit)? r
My move: paper
I win!
Your points: 0
My points: 1
---------------
Rock (r), paper (p), or scissors (s) (Q to quit)? P
My move: scissors
I win!
Your points: 0
My points: 2
---------------
Rock (r), paper (p), or scissors (s) (Q to quit)? S
My move: rock
I win!
Your points: 0
My points: 3
---------------
Rock (r), paper (p), or scissors (s) (Q to quit)? q
OK, bye!
The program validates user input, as shown. It loops until the user exits. It reports the scores after each turn.
Use at least two functions. Use more if you want.
Upload a zip of your project folder. The usual coding standards apply.
If you were logged in as a student, you could submit a solution to this exercise.
Where referenced