From 09aebd04a4bac8c3c35a2e05034d0bce5062a9ca Mon Sep 17 00:00:00 2001 From: Matt Hillsdon Date: Mon, 31 Oct 2022 11:14:06 +0000 Subject: [PATCH] Set the random number seed. It's used in a non-crypto safe RNG in MicroPython so just seed it with a Math.random-derived value. Closes https://github.com/microbit-foundation/micropython-microbit-v2-simulator/issues/85 --- src/demo.html | 1 + src/examples/random.py | 13 +++++++++++++ src/jshal.h | 2 ++ src/jshal.js | 9 ++++++++- src/microbithal_js.c | 5 ++--- 5 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 src/examples/random.py diff --git a/src/demo.html b/src/demo.html index cdcbfd44..5889f7cf 100644 --- a/src/demo.html +++ b/src/demo.html @@ -93,6 +93,7 @@

MicroPython-micro:bit simulator example embedding

+