Crates.io | alet |
lib.rs | alet |
version | 0.1.1 |
source | src |
created_at | 2023-10-19 20:56:17.836046 |
updated_at | 2023-10-20 00:17:10.789984 |
description | Simple and stright-forward random generator (wrapper to rand crate) - Inpired by the Python's random module |
homepage | https://github.com/EZSNoVa/alet |
repository | https://github.com/EZSNoVa/alet |
max_upload_size | |
id | 1008367 |
size | 5,181 |
A simple and straightforward random number generator library for Rust, inspired by Python's random
module.
// Generate a random float in the range [0.0, 1.0)
random();
// Generate a random integer in the range [a, b]
randint(1, 10);
// Generate a random unsigned integer in the range [a, b]
randuint(1, 10);
// Generate a random float in the range [a, b]
uniform(1.0, 10.0);
// Choose a random element from a sequence
choice(&[1, 2, 3, 4, 5]);
// Shuffle a sequence in-place
shuffle(&mut [1, 2, 3, 4, 5]);