aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Krňávek <Jan.Krnavek@gmail.com>2024-09-08 21:00:50 +0200
committerJan Krňávek <Jan.Krnavek@gmail.com>2024-09-08 21:02:16 +0200
commit9e60d0e949529c1091f962d9c8cd83716fb2da01 (patch)
tree56c3f3c35382f24ba840c085db66bbaed33b956a
parent0c9d8d680098f5515616488eceedbcfae8c5fea7 (diff)
downloadperlweeklychallenge-club-9e60d0e949529c1091f962d9c8cd83716fb2da01.tar.gz
perlweeklychallenge-club-9e60d0e949529c1091f962d9c8cd83716fb2da01.tar.bz2
perlweeklychallenge-club-9e60d0e949529c1091f962d9c8cd83716fb2da01.zip
solution week 285-1
-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
+}