Demonstrate how to pick a random element from a list.




use fmt;
use math::random;
use datetime;
 
export fn main() void = {
	const array = ["one", "two", "three", "four", "five"];
	const seed = datetime::now();
	const seed = datetime::nsec(&seed);
	let r = math::random::init(seed: u32);
 
	fmt::printfln("{}", array[math::random::u32n(&r, len(array): u32)])!;
};