This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:docs:randint [2013/01/18 18:17] – grauniad | crpl:docs:randint [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ~~DISCUSSION~~ | ||
| <- [[crpl: | <- [[crpl: | ||
| ===== RandInt | ===== RandInt | ||
| ^Arguments^Result^Notation^ | ^Arguments^Result^Notation^ | ||
| - | |Min, Max|Random Integer |'' | + | |A, B|Random Integer |'' |
| === Description === | === Description === | ||
| - | Pops Min and Max from the stack and pushes a random integer to stack where min <= RandInt < max. | + | //Pops A and B from the stack and pushes a random integer to the stack that can be any value from A up to, but not including, B.// |
| + | |||
| + | **In the case that '' | ||
| + | |||
| + | Pops A and B from the stack and pushes a random integer to stack where '' | ||
| + | |||
| + | |||
| + | **In the case that '' | ||
| + | |||
| + | Pops A and B from the stack and pushes a random integer to stack where '' | ||
| + | |||
| + | |||
| + | **In the case that '' | ||
| + | |||
| + | Pops A and B from the stack and pushes back a single integer equal to A and B. Example: '' | ||
| === Examples === | === Examples === | ||
| - | < | + | < |
| + | #Creates a dancing number readout. Very high tech hackery. | ||
| + | 0 10 RandInt | ||
| + | 0 10 RandInt concat | ||
| + | 0 10 RandInt concat | ||
| + | 0 10 RandInt concat | ||
| + | SetPopupText | ||
| + | |||
| + | :awake | ||
| + | TRUE OperateWhilePaused | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | # Showcases the difference between passing (Low, High) or (High, Low) into the function. | ||
| + | once | ||
| + | ClearTraceLog | ||
| + | ShowTraceLog | ||
| + | 50 0 do | ||
| + | # A B results | ||
| + | "lohi " -2 2 | ||
| + | "hilo " | ||
| + | loop | ||
| + | endonce | ||
| + | </ | ||