12.2 Random numbers
You can get a random number with the rand command.
The syntax of a rand command is rand <number>.
The <number> is the number possibilities from which you want rand to return a number.
If you want 2 possibilities you will have to use rand 2, but rand starts counting at zero so
this will either return a 0 or a 1. Thus the return of a rand command is a random number between 0 and
(<number> - 1).
For example rand 10 would give a random number between 0 and 9.
|