diff --git a/other/combinations.pl b/other/combinations.pl new file mode 100644 index 0000000..a66ce22 --- /dev/null +++ b/other/combinations.pl @@ -0,0 +1,6 @@ +use v6; + +multi combs(@, 0) { "" }; +multi combs { combs(@^dict, $^n - 1) X~ @dict }; + +(.say for combs(, $_)) for 1..4;