leopard-js / leopard

Library for making Scratch-like projects with JavaScript.
https://leopardjs.com
MIT License
136 stars 26 forks source link

The "pick random" function should accept strings #167

Open adroitwhiz opened 1 year ago

adroitwhiz commented 1 year ago

Scratch dynamically decides whether the "pick random" function should return an integer or a float based on whether or not its numeric inputs contain any decimal points. This is done with the string representation of the number, so e.g. "1.000" still counts as decimal.

Fixing this requires recoding the random function to accept strings.