Rock Paper Scissors [Alice 2]

Rock, Paper Scissor Game

We are going to create a Rock, Paper, Scissors game using Alice loops and if/else ‘s

  1. 1.Add a “rock”, “paper” and “scissors” objects to screen and enlarge them all to approximately the same size:rock-paper-scissors
  2. Make a Boolean variable called gamePlaying  and set its initial value to true : gamePlayingBoolean

3.Add a while loop based on gamePlaying

while loop

4. Make a variable called cpuChoice.   cpuChoice  is a number This variable will represent what the computer randomly chooses (rock, paper or scissors)

5. Use the world function that generates a random number so that the random number is an integer between 1 and 3 , inclusive.

alice-world-genare-random

Store the return value of that random number generator into cpuChoice  at the beginning of the loop

alice-random-range-

6. Debugging has many meanings. Experienced developers build debugging and logging into the development of their programs from the start.

  • We are going to do that in Alice by “watching” the cpuChoice variable

7. Right click on cpuChoice  and select watch this variable

alice-watch-variable

8 .Now we have the computer randomly choosing either 1,2, or 3 and these numbers will represent rock, paper and scissors respectively

So, what do you think we should do next?

Lesson continued here

rps__1