The Chance — Random Numbers
Generate random integer. Default range 0-100.
// Random 0-100
ayanmo n = Owonrin.random();
// Random 1-10
ayanmo dice = Owonrin.random(1, 6);
// Random 0-max
ayanmo percent = Owonrin.random(0, 100);
Randomly shuffle list elements.
ayanmo cards = [1, 2, 3, 4, 5];
ayanmo shuffled = Owonrin.shuffle(cards);
Irosu.fo(shuffled);
Pick random element from list.
ayanmo colors = ["red", "green", "blue"];
ayanmo choice = Owonrin.pick(colors);
Irosu.fo("Selected:");
Irosu.fo(choice);
// Simple dice game
Irosu.fo("Rolling dice...");
ayanmo player = Owonrin.random(1, 6);
ayanmo computer = Owonrin.random(1, 6);
Irosu.fo("You rolled:");
Irosu.fo(player);
Irosu.fo("Computer rolled:");
Irosu.fo(computer);
ti (player > computer) {
Irosu.fo("You win!");
} bib?k? ti (player < computer) {
Irosu.fo("Computer wins!");
} bib?k? {
Irosu.fo("Tie!");
}