From 9e60d0e949529c1091f962d9c8cd83716fb2da01 Mon Sep 17 00:00:00 2001 From: Jan Krňávek Date: Sun, 8 Sep 2024 21:00:50 +0200 Subject: solution week 285-1 --- challenge-285/wambash/raku/ch-1.raku | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 challenge-285/wambash/raku/ch-1.raku 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(, , ), 'A'; + is no_connection(), 'Z'; + done-testing; +} + +multi MAIN (+@routes) { + say no_connection +@routes +} -- cgit