- next if $dx == 0 && $dy == 0;
- next if $x2+$dx < 0 || $x2+$dx > 9;
- next if $y2+$dy < 0 || $y2+$dy > 9;
- next if $f{$x2+$dx,$y2+$dy};
- say $x2+$dx, ',', $y2+$dy, ' >',$m[$y2+$dy][$x2+$dx];
- next if ++$m[$y2+$dy][$x2+$dx] < 10;
- $f{$x2+$dx,$y2+$dy} = 1;
- push @q, [$x2+$dx, $y2+$dy];
- say "flashed ", $x2+$dx,',',$y2+$dy;
+ my ($x2, $y2) = ($x+$dx, $y+$dy);
+ next if $x2 < 0 || $x2 > 9;
+ next if $y2 < 0 || $y2 > 9;
+ next if $f{$x2,$y2};
+ next if ++$m[$y2][$x2] < 10;
+ $f{$x2,$y2} = 1;
+ push @q, [$x2, $y2];