ScratchData LogoScratchData
Back to DadOfMrLog's profile

Pseudorandom Cycle (for Williamja)

DADadOfMrLog•Created July 15, 2013
Pseudorandom Cycle (for Williamja)
23
20
1052 views
View on Scratch

Instructions

This project uses a pseudorandom cyclic sequence I came up with a few years ago that generates numbers in a fixed sequence from -2147483645 to +2147483645 (excluding zero), but in an order that appears random. SEE PROJECT: http://scratch.mit.edu/projects/11480048 for a test of the distribution of the generated numbers.

Description

>> UPDATE << fixed slight mistake when returning integer values from "pick random () to () with seed ()" custom block. --- In order for this to work it has to multiply some numbers that would normally overflow Scratch's digit precision limits. So I had to create a custom block which can cope with that. Unfortunately, because there's a fair bit of messing around with numbers in here, and because Scratch is fairly slow at interpreting script, it means this is very slow compared to the built-in "pick random..." It still generates thousands of values in a few seconds, though (but with the list showing it'll be even slower than that)...

Project Details

Project ID11432312
CreatedJuly 15, 2013
Last ModifiedJune 30, 2015
SharedJuly 16, 2013
Visibilityvisible
CommentsAllowed