Last active
December 18, 2015 10:59
-
-
Save samuraisam/5772440 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
say '1: ', join ", ", "x" x (2..10).roll xx 10; | |
say '2: ', join ", ", map "x" x *, (2..10).roll xx 10; | |
say '3: ', ((rand xx 10)>>*>>10)>>.floor.grep(* > 1).map("x" x *).join(", "); | |
say '4: ', (("x" x 10).substr(0,(2..10).roll) for ^10).join(', '); | |
print '5: '; | |
(2..10).roll(10) ==> map "x" x * ==> join ", " ==> say; | |
say '6: ', join ", ", do for ^10 {"x" x (2..9).pick} | |
# output: | |
# 1: xxxxxxxx, xxxxxxx, xxxxxxxx, xxxxxxxxxx, xx, xxxxxxxxx, xxxxxxxx, xxxxxxx, xxxxxxxx, xxxxxxxxx | |
# 2: xxx, xxxxxxx, xxx, xxxxx, xx, xxxxxxxxxx, xxxxxxxxx, xxxxxxx, xxxx, xx | |
# 3: xx, xxxxxxx, xxxxxx, xxxxxx, xxxxxx, xxxxx, xx, xxxxxxx | |
# 4: xx, xxx, xxx, xxxxx, xxxxx, xxxxx, xxxxxx, xxxxxxxx, xxxxxxxx, xxxx | |
# 5: xxxxxxxxxx, xxx, xxxxxxx, xx, xxxx, xxxxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxx | |
# 6: xx, xxxx, xx, xxxxxx, xxxxx, xxxxx, xxxxx, xxxxxxx, xxxxxxxx, xxxxxx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment