-
Notifications
You must be signed in to change notification settings - Fork 2
STL Random
TheRealMichaelWang edited this page Jun 30, 2021
·
2 revisions
The code found in this file implements a few wrapper methods around extern random to facilitate random number generation.
Type include "random.min" to include this library. If that isn't working, please make sure that:
- The unzipped contents of
stl.zipare placed in the working directory ofminima.exe. - Your version of minima is up to date.
include "random.min"
rem Generates a random numerical between 1 and 100
extern printl(goproc random(0, 100))
rem Generates a random value that is 1 or 0.
extern printl(goproc randbit)
rem Selects a random element of a collection/array and returns it.
extern printl(goproc select_random({"Hello!", "Hi!", "Greetings!"})
| Identifier | Expected Arguments | Functionality |
|---|---|---|
| random | min, max | Generates a random number greater than or equal to min and less than max. |
| randbit | Returns a random value that is either true/false. | |
| select_random | array | Selects a random element from array and returns it |