ScratchData LogoScratchData
Back to DadOfMrLog's profile

Pseudorandom cycle distribution check

DADadOfMrLog•Created July 18, 2013
Pseudorandom cycle distribution check
174
151
5065 views
View on Scratch

Instructions

This project generates the desired number of pseudorandom ints (range 1 to 10000) counting them into 'bins' to check distribution. NOTE: generating 10 million values takes a few minutes... SEE INSIDE: - The custom blocks in here can be used to generate seed-based pseudorandom numbers. It uses the pseudorandom cyclic sequence I came up with a few years ago that generates numbers in a random-looking sequence from -2147483645 to +2147483645 (excluding zero).

Description

>> UPDATE << Now graphs spectrum of bin values. --- In order for the cycle 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..." Still generates 1000s of values per second, though.

Project Details

Project ID11480048
CreatedJuly 18, 2013
Last ModifiedJuly 23, 2013
SharedJuly 18, 2013
Visibilityvisible
CommentsAllowed