woran liegt hier der Fehler?
Code: Alles auswählen
procedure trefferauswertung(j,k: integer);
var l: integer;
s: TObject;
begin
with form1 do begin
l:=0;
if j-1>=1 then if spielfeld[j-1,k]=bombe then inc(l); //^^
if j+1<=8 then if spielfeld[j+1,k]=bombe then inc(l); //v
if k-1>=1 then if spielfeld[j,k-1]=bombe then inc(l); //<
if k+1<=8 then if spielfeld[j,k+1]=bombe then inc(l); //>
if (j-1>=1)and(k-1>=1) then if spielfeld[j-1,k-1]=bombe then inc(l); //^^
if (j+1<=8)and(k+1<=8) then if spielfeld[j+1,k+1]=bombe then inc(l); //v
if (j+1<=8)and(k-1>=1) then if spielfeld[j+1,k-1]=bombe then inc(l); //<
if (j-1>=1)and(j+1<=8) then if spielfeld[j-1,k+1]=bombe then inc(l); //>
button[j,k].caption:=IntToStr(l);
if l=0 then
begin
if (j+1<=8) then trefferauswertung(j+1,k);
if (k+1<=8) then trefferauswertung(j,k+1);
if (j-1>=1) then trefferauswertung(j-1,k);
if (k-1>=1) then trefferauswertung(j,k-1);
if (j-1>=1)and(k-1>=1) then trefferauswertung(j-1,k-1);
if (j+1<=8)and(k+1<=8) then trefferauswertung(j+1,k+1);
if (j+1<=8)and(k-1>=1) then trefferauswertung(j+1,k-1);
if (j-1>=1)and(j+1<=8) then trefferauswertung(j-1,k+1);
end;
end;
end;