Booleans
| Item | Summary |
|---|---|
random | Returns true or false, each with equal chance |
Associated Functions
random
fn random() -> bool
Returns true or false, each with equal chance.
let side = if bool::random() "heads" else "tails";
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
| Item | Summary |
|---|---|
random | Returns true or false, each with equal chance |
randomfn random() -> bool
Returns true or false, each with equal chance.
let side = if bool::random() "heads" else "tails";