This repository was archived by the owner on Jan 26, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
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.
ICE Compiler | Peter Tillema
- Introduction
- Building your first program
- Math and numbers
- Variables
- Standard system commands
- Program flow control
- Pointers
- Graphics
- Sprites
- Tilemaps
- Useful routines