Random Number Generator
We can generate a random number in Scratch between any two numbers (inclusive) using the
pick random block:
This will report an integer 1, 2, 3, 4, 5, 6, 7, 8, 9, or 10—each with 1/10 probability. This type of block (with the round edges) is a reporter block—it reports a value. We can use this block inside other blocks that take a value:
In other words, a reporter block can be used in any case that a manually entered value or variable can. You can even use
pick random blocks as the parameters to other
pick random blocks:
What do you think this complex combination of blocks does?
Your job is to make a sprite move around the screen randomly. Load your Scratch program from Game of Tag, and adjust it as follows:
- Make one character move around randomly, but still stay within the confines of the screen. You can do this with the
if on edge, bounceblock.
pick randomto change the second sprite’s appearance. You can vary many different factors in the “Looks” tab, including size, costume, as well as many colorizing and distorting effects.
- Be personalized in at least three ways.
- Be usable, efficient, and effective.
- Provide documentation (describe what it does) in the Instructions. Be sure to describe how your program is original.