[Purdue-pm] Perl Weekly Challenge hints

Mark Senn mark at purdue.edu
Wed Jul 17 07:22:09 PDT 2019


Why yes---I am trying to get people interested in Perl 6.
You'll thank me in the long run I think.


Perl 6 hints to this week's Perl Weekly Challenge
See
https://perlweeklychallenge.org/blog/perl-weekly-challenge-017/
for this week's weekly challenge


Hints to
https://perlweeklychallenge.org/blog/perl-weekly-challenge-017/#task-1

multi A(Int $m, Int $n where $m == 0)           { return $n + 1 }
multi A(Int $m, Int $n where $m >  0 && $n > 0) { return A($m-1, A($m,$n-1)) }

say A(1, 2);


Hints to
https://perlweeklychallenge.org/blog/perl-weekly-challenge-017/#task-2

https://docs.perl6.org/language/regexes
especially https://docs.perl6.org/language/regexes#Capturing_groups
use ':' (including the quotes) to match a colon literally
use <[a..z]> to match a lowercase letter
https://docs.perl6.org/language/grammars/#Named_Regexes demos named regexes
https://docs.perl6.org/language/regexes#Named_captures demos named captures


-mark


More information about the Purdue-pm mailing list