Fix typo.

This commit is contained in:
Sebastian Bugge 2024-12-04 08:26:31 +01:00
parent d66e690966
commit 0413fcdde5
Signed by: kaholaz
GPG key ID: 2EFFEDEE03519691

View file

@ -29,7 +29,7 @@ my $mas_cross_count = 0;
for my $y (0 .. $#wordgrid) { for my $y (0 .. $#wordgrid) {
for my $x (0 .. $#{$wordgrid[$y]}) { for my $x (0 .. $#{$wordgrid[$y]}) {
$xmas_count += grep { search_xmas([$x, $y], $_)} @directions; $xmas_count += grep { search_xmas([$x, $y], $_)} @directions;
$mas_cross_count++ if search_max_cross([ $x, $y ]); $mas_cross_count++ if search_mas_cross([ $x, $y ]);
} }
} }
@ -51,7 +51,7 @@ sub search_xmas {
return 1; return 1;
} }
sub search_max_cross { sub search_mas_cross {
my $start = shift; my $start = shift;
return 0 if $wordgrid[$start->[1]][$start->[0]] ne "A"; return 0 if $wordgrid[$start->[1]][$start->[0]] ne "A";
return 0 if ( return 0 if (