# Magic 8

## Let the Calliope mini tell you the future.

#### from 8 years on

In this exercise, we will use the Open Roberta editor. Make sure that you see this picture in the upper right corner of your programming environment. The editor can be found on our website at the top of the navigation bar: Let's start - Editor.

# First steps: Fortune telling ball

1Setting variables

First, you create a variable. Click on the + symbol in the Start block. Then name the variable with random.

2Question mark

To display a question mark at the start of the mini, take the show text block you find under action, change text to character and enter a question mark.

3Infinite loop

Select the following block in the menu under control to play your following code in an endless loop.

4Setting conditions

Now select the if - do block under control to set the condition. Then add the get shaking gesture from the sensors menu to control the position sensor. In the selection change upright to shaken.
Next, select the set random block from the variables menu. To these you add the integer random value between 1 and 100 block, from the math menu, change the 1 to a 0 and the 100 to a 3.
Now the value of the variable random is randomly set to a number from zero to three.

Now add another if - do block and add the block = from the logic menu to it. Now you fill the block with the random variable, from the variables menu and a 0 to set the condition for the value zero of the variable. Then take a show text block and enter your answer in the text box.

You can duplicate this if - do block four times. To do this, right-click on the if - do block and choose copy. For the further random numbers 1-3 of your duplicated blocks you can now define the statements. In each of the three blocks, make the following statements:

1. change the random number