This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
crpl:docs:randint [2013/01/14 14:06] – created chani | crpl:docs:randint [2020/05/26 18:23] – Added a Note and example for special cases Sanian | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | TODO | + | <- [[crpl: |
+ | ===== RandInt | ||
+ | |||
+ | ^Arguments^Result^Notation^ | ||
+ | |Min, Max|Random Integer |'' | ||
+ | |||
+ | |||
+ | === Description === | ||
+ | Pops Min and Max from the stack and pushes a random integer to stack where '' | ||
+ | |||
+ | **Note:** Min may be higher than Max, however the resulting value will follow a different rule where '' | ||
+ | === 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 | ||
+ | # | ||
+ | "lohi " -2 2 | ||
+ | "hilo " | ||
+ | loop | ||
+ | endonce | ||
+ | </ | ||
+ |