Buckaroo Math Game

Objective: Get as close to 10 000 without going over. The person with the highest score wins.

The robot will pick 5 random numbers. You can decide to add the random number x 1, x 10, x 100 or x 1000. That number will be added to your score. You must use all 5 random numbers.

For example: Ahmed is playing Bob.

  1. Ahmed gets a 5 and decides to do 5 x 1000 = 5000
  2. He next gets a 9. If he picked 9 x 1000 = 9000 + his score of 5000, he'll be over 10 000 so instead he decides to use 9 x 100 = 900  so 900 + 5000 = 5900
  3. He next gets another 9. He decides to use 9 x 100 = 900 again. His new score is 900 + 5900 = 6800
  4. He next gets a 4. He does 4 x 100 = 400. His score is now 400 + 6800 = 7200
  5. His last number is a 5. He uses 5 x 100 = 500. His final score is 7700 which is not a great score.

Bob tries his luck:

  1. Bob gets a 9 and uses 9 x 1000 = 9000
  2. He gets an 8 and decides on 8 x 100 = 800 His score is now 800 + 9000 = 9800
  3. He gets a 7 and, by accident, selects 7 x 100 = 700. His score is 10 500. He is over 10 000 and instantly loses.

First create four variables:

The variables to create.

Here is an overview of the program:

The Whole Program

Green Area

The Green areas are for experts working on the flag variable called "Add Now" and the loops. Also look at the blue area to see your last job.

Top Loop

 

The first block is set to False. Inside the loop, wait for the middle button to be pushed, then set "Add Now" to True

Starting False

 

We had some groups adding sounds and found the users would sometimes hit the middle button again. This is to insure the flag is False.

 

 

This reads the flag and jumps out of the loop if it is True.

Yellow Areas

The Yellow areas are helping the user select which power of 10 to use.

Pick random

This picks a random number between 1 and 9 and puts it into the Random Variable

The Power loop

This is the Power Select loop. Each time the user presses the left arrow button, the power is multiplied by 10. If the power is over 1000, it is set back to 1.

Red Area

The Red areas are running the display and the calculations.

Running the game

This takes the present score and calculates the random number x the power and displays it on the screen. Notice all the variables are "Read" in this loop.

The Blue Areas

The blue areas are calculating the score for each turn and displaying the final score.

The first blue area calculates the new score and puts it in the variable. Notice that there is no display block in this section. The final blue area displays the final score in the middle and waits for 30 seconds to give the user bragging rights. The green loop between the two blue areas count the number of random numbers that are given. For more challenge, increase this number!

 

Kit: 
File attachments: