return if index(substr($grid_v, $x*$size, $size), $n) >= 0; #### foreach my $y_ (0 .. $size-1) { return if substr($grid_h, $y_*$size+$x, 1) eq $n; }