# Rock Paper Scissors

1. Start

2. Set integer values for rock, paper and scissors. With paper = 1, rock = 2, and scissors = 3.

3. Give the player \$100.

4. Set play_again = 1.

5. Does play_again = 1? If yes, proceed. If no, go to Step 34.

6. Ask the player to input their move.

7. Does the player not have \$0? If yes, proceed. If no, go to Step 11.

8. Display how much money the player has and ask them how much they would like to bet. Set player_bet equal to this value.

9. Is the player’s bet greater than their total amount of money? If yes, proceed. If no, go to Step 12.

10. Inform the player of their invalid bet and ask them to redo their bet. Go to Step 12.

11. Inform the player that they don’t have any money and therefore cannot bet.

12. Determine the computer’s move by randomly choosing between 1, 2 or 3.

13. Is the computer’s move equal to 1? If yes, proceed. If no, go to Step 15.

14. Inform the player that the computer’s move is paper. Go to Step 18.

15. Is the computer’s move equal to 2? If yes, proceed. If no, go to Step 17.

16. Inform the player that the computer’s move is rock. Go to Step 18.

17. Inform the player that the computer’s move is scissors. Go to Step 18.

18. Set both player_win and computer_win to 0.

19. If the player’s move = 3 and the computer’s move = 1, inform the player that scissors cut paper and that the player wins, set player_win to 1 and go to Step 26. If not, proceed.

20. If the player’s move = 3 and the computer’s move = 2, inform the player that rock crushes scissors and that the computer wins, set computer_win to 1, and go to Step 26. If not, proceed.

21. If player’s move = 2 and the computer’s move = 1, inform the player that paper covers rock and that the computer wins, set computer_win to 1, and go to Step 26. If not, proceed.

22. If the player’s move = 2 and the computer’s move = 3, inform the player that rock crushes scissors and that the player wins, set player_win to 1 and go to Step 26. If not, proceed.

23. If the player’s move = 1 and the computer’s move = 2, inform the player that paper covers rock and that the player wins, set player_win to 1 and go to Step 26. If not, proceed.

24. If player’s move = 1 and the computer’s move = 3, inform the player that scissors cut paper and that the computer wins, set computer_win to 1, and go to Step 26. If not, proceed.

25. Inform the player that they have done the same move as the computer and that there is a tie.

26. Does the player’s money total not equal 0? If yes, proceed. If no, go to Step 30.

27. If player_win = 1, then add player_bet to the player’s total money. Go to Step 31.

28. If computer_win =1, then subtract player_bet from the player’s total money. Go to Step 31.

29. Keep the player’s money total the same. Go to Step 31.

30. Keep the player’s money total at 0.

31. Inform the player of how much money they have.

32. Set yes = 1 and no =0.

33. Ask the player if they would like to play again. Set play_again equal to this value. Go to Step 5.

34. End.