This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| crpl:docs:randint [2020/05/26 22:23] – Added a Note and example for special cases Sanian | crpl:docs:randint [2025/02/14 14:57] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| ^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 '' | + | //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: '' | ||
| - | **Note:** Min may be higher than Max, however the resulting value will follow a different rule where '' | ||
| === Examples === | === Examples === | ||
| < | < | ||
| Line 29: | Line 42: | ||
| ShowTraceLog | ShowTraceLog | ||
| 50 0 do | 50 0 do | ||
| - | # min max results | + | # |
| - | "lohi " -2 2 | + | "lohi " -2 2 |
| - | "hilo " | + | "hilo " |
| loop | loop | ||
| endonce | endonce | ||