aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-285/wambash/raku/ch-1.raku19
1 files changed, 19 insertions, 0 deletions
diff --git a/challenge-285/wambash/raku/ch-1.raku b/challenge-285/wambash/raku/ch-1.raku
new file mode 100644
index 0000000000..dc74e10a33
--- /dev/null
+++ b/challenge-285/wambash/raku/ch-1.raku
@@ -0,0 +1,19 @@
+#!/usr/bin/env raku
+
+multi no_connection (+@ ($from, $to)) { $to }
+multi no_connection (+@routes) {
+ my :(@from, @to) := [Z] @routes;
+
+ @to.first: { $_ ∉ @from }
+}
+
+multi MAIN (Bool :test($)!) {
+ use Test;
+ is no_connection(<B C>, <D B>, <C A>), 'A';
+ is no_connection(<A Z>), 'Z';
+ done-testing;
+}
+
+multi MAIN (+@routes) {
+ say no_connection +@routes
+}