Glossary for Alice Programming: random
Learn Alice in FREE step-by-step lessons.
addition quiz: Bears ask you to add numbers, then tells how many you got right.
Addition Quizcounting quiz: How many fish do you see? (Some of the fish are invisible.)
A Counting Quizfish-back-forth: Random numbers for the distance to swim makes it more realistic.
A Fish swims back and forthguess number: Loops until the user guesses the number: give hints "too high" and "too low"
Guess the Aliens numberpenguin jumping up and down: Use a random value each time he jumps to make it look more realistic.
A Penguin Jumps Up and Downrandom amount to turn: A random double
Panda Turns a Random Amountrandom number: Alice has a few functions that return pseudo random numbers. Random numbers can be used to create games, and also to create more natural movements. For instance, when you walk, every step is not exactly the same size. Using a random number for the size of the step will make the movement more realistic. Instead of stepping a distance of exactly 1.1, you might use a random number between 0.9 and 1.2
random1: Uses textModel to display a random double value between 0 and 1.
Displaying some random valuesrandom2: A random integer from 1 to 6 inclusive to roll die
Displaying values from 1 to 6Full Glossary