glob $sb{8}{8}="none" $sb{1..8}{2}="wB" ($sb{1}{1}, $sb{8}{1})="wT"; ($sb{2}{1}, $sb{7}{1})="wS"; ($sb{3}{1}, $sb{6}{1})="wL"; #push(@Orte,$_); $sb{4}{1}="wD"; $sb{5}{1})="wK"; $sb{1..8}{7}="sB"; ($sb{1}{8}, $sb{8}{1})="sT"; ($sb{2}{8}, $sb{7}{1})="sS"; ($sb{3}{8}, $sb{6}{1})="sL"; $sb{4}{8}="sD"; $sb{5}{8})="sK"; for($i2=1; $i2 <= 8; $i2++;){ for($n2=1; $n2 <= 8 $n2++;){ $dings[$n2][$i2]="$n2 $i2"; } } #bauer if ( $sb[$fx][$fy] == "wB" && ($fy+1==$ty) || #normal ($fy==2 && $fy+2==$ty && $sb[$fy][3]!="w*") || #doppelsprung ($fy+1==$ty && $fx+(1||-1)==$tx && $sb[$tx][$ty]=="s*") #schlagen #el passant kann nicht (korrekt) berücksichtigt werden, da spiel verlauf net gelogt wird ) {MOVE; push(@bedrohte_felder, $dings[ty+1][$tx+1, $tx-1)]); exit;} #springer if ( $sb[$fx][$fy] == "wS" && #alle möglichen springer kombis ((($fx-1==$tx && $fy+2==$ty) || ($fx+1==$tx && $fy+2==$ty) || ($fx-1==$tx && $fy-2==$ty) || ($fx+1==$tx && $fy-2==$ty) || ($fx-2==$tx && $fy+1==$ty) || ($fx+2==$tx && $fy+1==$ty) || ($fx-2==$tx && $fy-1==$ty) || ($fx+2==$tx && $fy-1==$ty) )) && ($sb[$tx][$ty]!== "w*")) ) {MOVE; push(@bedrohte_felder, $dings[$fx-1==$tx][$fy+2==$ty], $dings[$fx+1==$tx][$fy+2==$ty], $dings[$fx-1==$t][$fy-2==$ty], $dings[$fx+1==$tx], $dings$fy-2==$ty], $dings[$fx-2==$tx][$fy+1==$ty], $dings[$fx+2==$tx][$fy+1==$ty], $dings[$fx-2==$tx][$fy-1==$ty], $dings[$fx+2==$tx][$fy-1==$ty]; exit;} sub MOVE{ $sb{$fx}{$fy} = $sb{$tx}{$ty} $sb{$fx}{$fy} = "none" } sub PRINT{ for($i=1; $i <= 8; $i++;){ for($n=1; $n <= 8 $n++;) {print ""} print "
" } }