Module rune_modules::rand [−][src]
The native rand
module for the Rune Language.
Usage
Add the following to your Cargo.toml
:
rune-modules = {version = "0.9.0", features = ["rand"]}
Install it into your context:
let mut context = runestick::Context::with_default_modules()?; context.install(&rune_modules::rand::module(true)?)?;
Use it in Rune:
ⓘ
fn main() { let rng = rand::WyRand::new(); let rand_int = rng.int(); println(`Random int: {rand_int}`); let rand_int_range = rng.int_range(-100, 100); println(`Random int between -100 and 100: {rand_int_range}`); }
Functions
module | Construct the |