Gossip
On this page, you will improve your program so that sometimes the sentences are a bit longer and more complex.
who
. Otherwise, it reports who
, just as before.
who
.more complicated who
. There are two new things in it: pick random
and if else
.random
block do?more complicated who
block, what happens if the pick random
block picks 3? What if it picks 4?
more complicated who
pick the more complicated choice?
more complicated who
. What change to this script will make the more complicated phrase appear more often?
RANDOM(1, 10)or . Every time you run this code, you will get a different random number between 1 and 10.
An even number is an integer that is divisible by 2 (such as 2, 14, 0, -4, -6, -28, and -176).
In contrast, odd numbers are integers not divisible by 2 (such as 1, 3, 9, 17, -5, -33, and -221).
RANDOM(2, 10)
RANDOM(2, 10)will return 2, 3, 4, 5, 6, 7, 8, 9, or 10.
2 * RANDOM(1, 5)
RANDOM(1, 5)will return 1, 2, 3, 4, or 5, and so
2 * RANDOM(1, 5)will return 2, 4, 6, 8, or 10.
RANDOM(1, 10) / 2
RANDOM(1, 10)will return 1, 2, 3, 4, 5, 6, 7, 8, 9, or 10, and so
RANDOM(1, 10) / 2will return ½, 1, 1 ½, 2, 2 ½, 3, 3 ½, 4, 4 ½, 5.
RANDOM(1, 5)
RANDOM(1, 5)will return 1, 2, 3, 4, or 5.
RANDOM(1, 6) + RANDOM(1, 6)
RANDOM(1, 6)will return 1, 2, 3, 4, 5, or 6 with equal probability, simulating one die, and so
RANDOM(1, 6) + RANDOM(1, 6)will return 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, or 12 with the same probability as two dice.
2 * RANDOM(1, 6)
RANDOM(1, 6)for the roll of a single die. But this expression doesn't roll two dice; it rolls one die and doubles the result. So
2 * RANDOM(1, 6)will only return 2, 4, 6, 8, 10, or 12.
RANDOM(2, 12)
RANDOM(2, 12)will return 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, or 12 equally often. Do you score 2 rolling two dice as often as you score 6?
RANDOM(1, 12)
gossip
but that uses more complicated who
instead of who
. (You can choose which who
to replace, or you could replace both.) complicated gossip
instead of gossip
. Run your code, and fix any problems.more complicated who
. Replace one of the who
blocks with a fresh copy of more complicated who
that you drag in from the palette. Click more complicated who
enough times to see how it has changed.more complicated who
give the more complicated response three out of four times instead of one out of four times.