ScratchData LogoScratchData
Back to Flint-L's profile

Random number without "random" block

FLFlint-L•Created November 7, 2014
Random number without "random" block
72
48
2150 views
View on Scratch

Instructions

Turbo mode (SHIFT + Click green flag). Space for next random number. Press "q" to reseed the cells with the current time (so if you want it to be something besides 115, press q). Random number = 0-255 16 Bit Number = 0-65535 Curated by @flamingenius on 19/11/14 at 10:24 p.m. Thanks! This will generate a random number without the need for a "pick random block," using Stephen Wolfram's Rule 30. Feel free to use this for whatever you would like. Credit is appreciated. Note: If you want to make a project without turbo mode, you can easily change it by making custom blocks with the "run without screen refresh" box checked. You can also add more bits; put in the number of bits you want and the first bit value.

Description

The idea for this came from Stephen Wolfram's "A New Kind of Science." It works like this: Calculate the next line of cells for Wolfram's Rule 30 (http://en.wikipedia.org/wiki/Rule_30). Add the center item of the line to both of the binary lists. When the binary lists reach 8 or 16, the bits are added up to an 8 bit or 16 bit number, respectively. The reseeding is also quite simple: Add the current hour, minute, and second together. Convert to binary and store in "current cells."

Project Details

Project ID33239760
CreatedNovember 7, 2014
Last ModifiedJanuary 3, 2015
SharedNovember 8, 2014
Visibilityvisible
CommentsAllowed