Skip to content
This repository was archived by the owner on Jan 26, 2022. It is now read-only.

rand and randInt

Peter Tillema edited this page Sep 15, 2018 · 3 revisions

rand is simple, you put it somewhere, and it gives you a pseudo-random number between 0 and 16777215. Pseudo-random means that the number is not completely random, because computers cannot actually generate random values, they instead take a starting number (called the seed) and apply a bunch of operations to it and spit out another number. Example:

rand→A

A could now be 64, it could be 7777, who knows? It's random!

randInt( works basically the same as rand, except that you specify a range where the random number should be in. So something like randInt(1,6) returns a random number in between 1 and 6, like a dice.

Clone this wiki locally