Quick actions

cmd+k|ctrl+k

Navigation

Languages

G_24_02_a (ab5tract)

Snippet info

Language

Raku

Visibility

unlisted

Author

legacy-anonymous

Created

2024-12-03T21:25:59.028339Z

Updated

2024-12-03T21:25:59.028339Z

#!/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