Skip to content

Commit

Permalink
masak++ \'s combinations solution.
Browse files Browse the repository at this point in the history
  • Loading branch information
Filip Sergot committed Apr 21, 2012
1 parent 7f7a7c5 commit 80e1d29
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions other/combinations.pl
@@ -0,0 +1,6 @@
use v6;

multi combs(@, 0) { "" };
multi combs { combs(@^dict, $^n - 1) X~ @dict };

(.say for combs(<a b c>, $_)) for 1..4;

0 comments on commit 80e1d29

Please sign in to comment.