Skip to content

Instantly share code, notes, and snippets.

@samuraisam
Last active December 18, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save samuraisam/5772440 to your computer and use it in GitHub Desktop.
Save samuraisam/5772440 to your computer and use it in GitHub Desktop.
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