Step 4: Choosing a Random Hole Part 2

Goal:


The code we just completed will place a mole in hole number 1 if it has been chosen.

We now need to write very similar code for the other 5 holes if they are chosen.

Steps:

  1. From Control, place an IF/THEN block.
  2. From Operators, place an = block and place it inside the IF/THEN block.
  3. From Variables, place a round positionChooser block on the left side of the = block.
  4. Type in the number 2 on the right side of the = block.
  5. From Variables, place a set to block inside the IF/THEN block. Set the variable to nextX and the number to 0.
  6. From Variables, place a set to block under the previous one. Set the variable to nextY and the number to 60.
  7. Repeat this process 2 more times, editing the numbers so that your code looks exactly like the code shown.

Code: