123456
if ( (( $z == $LM[$x-1][$y-1] + 2 ) or ( $z == $LM[$x-1][$y-1] - 1 )) and ($x > 1 and $y > 1) ) {
my @WM; ; #### Wegematrix