Odd word problem
my &in = { $*IN.getc // last }
loop {
ew(in);
ow(in).print;
}
multi ew ($_ where /\w/) { .print; ew(in); }
multi ew ($_) { .print; next when "\n"; }
multi ow ($_ where /\w/) { ow(in) x .print; }
multi ow ($_) { $_; }Output:
$ ./oddword
we,are;not,in,kansas;any,more.
we,era;not,ni,kansas;yna,more.
what,is,the;meaning,of:life.
what,si,the;gninaem,of:efil.Last updated