pxt icon indicating copy to clipboard operation
pxt copied to clipboard

no function to set SEED for random number generator

Open PSLLSP opened this issue 10 months ago • 1 comments
trafficstars

Makecode has no function/block to set SEED value used by random numbers generator. Current situation is that random number sequence repeats after each reset. That makes games predictable, etc. Could be a function added to allow set SEED to predefined value or just some random value (I understand this is a tricky, maybe some timer or sensor value could be used). JavaScript has function Math.random(), could be block for this function added to Makecode?

PSLLSP avatar Jan 01 '25 14:01 PSLLSP