aboutsummaryrefslogtreecommitdiff
path: root/challenge-122/markus-holzer/raku/ch-2.raku
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-122/markus-holzer/raku/ch-2.raku')
-rw-r--r--challenge-122/markus-holzer/raku/ch-2.raku12
1 files changed, 12 insertions, 0 deletions
diff --git a/challenge-122/markus-holzer/raku/ch-2.raku b/challenge-122/markus-holzer/raku/ch-2.raku
new file mode 100644
index 0000000000..39128f21c1
--- /dev/null
+++ b/challenge-122/markus-holzer/raku/ch-2.raku
@@ -0,0 +1,12 @@
+# Write a script to find out the different ways you can score $S points in basketball
+
+multi points( $S, *@c where @c.sum == $S ) {
+ take @c and nextsame;
+}
+
+multi points( $S, *@c where @c.sum <= $S ) {
+ points $S, @c, $_ for 1..3 }
+
+multi points( | ) { }
+
+say gather points 6; \ No newline at end of file