tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,3 @@
|
|||
(1..6).roll; # return 1 random value in the range 1 through 6
|
||||
(1..6).roll(3); # return a list of 3 random values in the range 1 through 6
|
||||
(1..6).roll(*); # return a lazy infinite list of random values in the range 1 through 6
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# define the deck
|
||||
constant deck = 2..9, <J Q K A> X~ <♠ ♣ ♥ ♦>;
|
||||
deck.pick; # Pick a card
|
||||
deck.pick(5); # Draw 5
|
||||
deck.pick(*); # Get a shuffled deck
|
||||
|
|
@ -0,0 +1 @@
|
|||
@array[@array * rand]
|
||||
|
|
@ -0,0 +1 @@
|
|||
say Bool.pick; # returns either True or False
|
||||
Loading…
Add table
Add a link
Reference in a new issue