-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Repeat Pick Random not random adafruit curcuit playground blocks #1179
Comments
@mmoskal FYI |
feel free to ping me when you're doing next release |
I ran into this too. I believe the random seed is hardcoded for the SAMD21 boards (like CPX), and this is an issue upstream rather than in pxt-adafruit. For example a simple program that prints 20 random numbers in the range 0-10:
...will always start: See the initRandomSeed() implementation here; the seed is fixed: The core platform has an implementation of initRandomSeed() that takes input from the temperature + light sensors, which should make it more random; maybe that could be ported to core---samd? As a workaround I made a function that uses the light + sound sensors to add entropy:
|
https://makecode.com/_CYU1mq4atcRV
I loaded this on 2 Adafruit Curcuit Playgound devices. They synch start, but despite being told to pick a random number of repeat times, both controllers repeat the loops the same amount of times. So the sequence progresses through the music in the same way. Why would the random seed be the same each time it is run?
Describe the bug*
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Add screenshots to help explain your problem. You can copy paste the screenshot in the github report. The .gif screen recording is very useful as well.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: