My students are trying to send in a parameter for the opacity of the PenRGB command. When they do, the opacity doesn’t change. In some iterations, the snowflake (see below) in the example doesn’t show at all. Is it possible to randomize opacity?
randomNumber(0,1) will only toggle between 0 and 1. It does not return any decimal number. In order to get decimal numbers between 0 and 1, try this randomNumber(0,100)/100.0
Thank you, thank you, thank you! This makes perfect sense.
An even better solution is just to use
random() //returns a float between 0 and 1
Hm, I don’t see that anywhere in the toolbox and I got an error when I tried to use that. I assume you’re referring instead to Math.random(), which seems to match the description you gave.
Also I think it’s great that we promote multiple ways of solving the same problem.
You’re right. random() doesn’t actually exist on app lab. However it does exist on game lab so I guess that’s how I ended up with “random.”