Block Idea: New Random Math Block

It is chance…

number=math.random()
If number <0.5
—do something 
else
— do something else
end

Is the definition of chance

3 Likes

I like this idea

1 Like

Cool, but a little confusing. (Don’t mind me, everything is confusing)

1 Like

So it’s more likely to be a lower or higher number. It’s actually a feature I needed for some of my older projects.

1 Like

Because its a bit Begginer friendly and to make it precise
(e.g. there is a 20% chance to an egg to spawn and a 70% chance to a cookie to spawn)

why can’t you just do

var x = Random (0) to (100)
if x < 40 {
  var y = 1 // 40% chance
} else {
  var y = 2 // 60% chance 
}
3 Likes

This would be a good idea, but I think you can work around it in the meantime.

1 Like

You could also use modulo for this as well

1 Like