Quick actions

cmd+k|ctrl+k

Navigation

Languages

Untitled

Snippet info

Language

Raku

Visibility

unlisted

Author

legacy-anonymous

Created

2024-12-03T21:59:43.540079Z

Updated

2024-12-03T21:59:43.540079Z

#!/usr/bin/env raku
use v6.d;

grammar G_24_02_a {
    token TOP    { <report>+ }
    token report { <level> ** 1..5 }
    token level  { <value> \s? }
    token value  { <digit> <digit>? }
}

my $input = chomp q:to/INPUT/;
77 6 4 2 1
1 2 7 8 9
9 7 6 2 1
1 3 2 4 5
8 6 4 4 1
12 3 99
INPUT

say G_24_02_a.parse($input);

dd $input
INFO