# Random Numbers

The goal of this lesson is to learn to use random numbers.
Random numbers make it possible to create games and to make the movements of the characters more natural.

We can use random numbers in many ways.
One thing we can do with random users is to flip a coin or select a card from a deck. Those are things that we think of as random.
We can also use random numbers to make movement seem more natural.
When a person jumps up and down, they don't jump exactly the same amount each time, so we could have them jump a random amount within a range.

In order to do this you will:

• Write code to generate random numbers in 2 different ways.
• Use random values in your animation procedures so that characters move more naturally.
(For example, a fish swimming back and forth doesn't move exactly the same amount each time.)
• Use loops to create a number guessing game with hints "too high" and "too low"

### Print the lesson

1. Displaying some random values: Uses textModel to display a random double value between 0 and 1.
2. Displaying values from 1 to 6: A random integer from 1 to 6 inclusive
3. A Counting Quiz: How many fish do you see? (Some of the fish are invisible.)
5. Guess the Aliens number: Loops until the user guesses the number: give hints "too high" and "too low"
6. A Penguin Jumps Up and Down: Use a random value each time he jumps to make it look more realistic.
7. A Fish swims back and forth: Random numbers for the distance to swhim makes it more realistic.
8. Self Study Questions
9. Discussion Questions

#### Active Learning

Create a soccer match