Skip to content

Instantly share code, notes, and snippets.

@raydiak
Last active April 25, 2021 02:31
Show Gist options
  • Save raydiak/59350a91715982755e8ffe4a76d6667b to your computer and use it in GitHub Desktop.
Save raydiak/59350a91715982755e8ffe4a76d6667b to your computer and use it in GitHub Desktop.
slots
#!/usr/bin/env raku
my Int $cost = 1;
my %wheel = 7 => 20, 'πŸ‘' => 10, 'πŸ’' => 8, 'πŸ‰' => 6, 'πŸ“' => 5, 'πŸ‡' => 4, '🍍' => 3;
my @result = %wheel.keys.roll(3);
say @result;
if [eq] @result {
my $profit = $cost * %wheel{@result[0]};
say 'win' ~ " ($profit)";
} else {
say 'lose';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment