ScratchData LogoScratchData
Back to ABC124816's profile

New Random Number Generator (RNG)

ABABC124816•Created February 18, 2023
New Random Number Generator (RNG)
0
0
5 views
View on Scratch

Instructions

(NOTE: Read all of this before starting the project.) (NOTE: Use turbo mode if you want to detect loops. (See notes and credits.)) This is a RNG based on a seed which generates random numbers from 0 to 65536 (not using Scratch's RNG all the time!) and above (which is 2^2^2^2 if you think that's an arbitrary number.) It, in principle, can report any number between 0 and 65536 except 1, 1791, and 14374 (see notes and credits to see why). When it gets any of these values, it uses Scratch's RNG to reset the seed. The scratch count tracks how many times this happens. The new count tracks how many times the new RNG has been used. The scratch or new? variable says which RNG generated the current number. 91.9% of the RNG is composed of the new RNG (which is what you get in the 'percentage of new' variable after sometime using turbo mode.).

Description

(WARNING: If you want to use this for your projects, DO NOT delete the two blank backdrops! They are used for recursion and detecting turbo mode.) The reason scratch's RNG is used occasionally is because sometimes it gets stuck in a loop. When this happens, the scratch count stops increasing even in turbo mode for a long time (that is how I detect loops) So far I found these loops (Let me know if you find any more!), and added exceptions to them: { '-' means 'goes to'} Infinity-Infinity 1-1 1791-2995-1791 14374-17946-20341-24597-14374

Project Details

Project ID806248434
CreatedFebruary 18, 2023
Last ModifiedFebruary 21, 2023
SharedFebruary 20, 2023
Visibilityvisible
CommentsAllowed