vielleicht kannst Du damit was anfangen, schnell hingetippt,nicht großartig getestet
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
type TZCount=Array[1..9] of Integer;
var
x,y,xx,yy:Integer;
ZCount:TZCount;
Procedure ClearZCount;
var
i:Integer;
begin
for I := 1 to 9 do ZCount[i]:=0;
end;
Procedure Doublette;
var
i:Integer;
begin
for I := 1 to 9 do if ZCount[i]>1 then Showmessage('Doublette');
end;
Procedure Add2Zcount(z:Integer);
begin
if (z>0) and (z<10) then inc(ZCount[z]);
end;
begin
for y := 0 to 8 do
begin
ClearZCount;
for x := 0 to 8 do Add2Zcount(sud[y,x]);
Doublette;
end;
for x := 0 to 8 do
begin
ClearZCount;
for y := 0 to 8 do Add2Zcount(sud[y,x]);
Doublette;
end;
for xx := 0 to 2 do
for yy := 0 to 2 do
begin
ClearZCount;
for y := yy*3 to yy*3 + 2 do
begin
for x := xx*3 to xx*3 + 2 do Add2Zcount(sud[y,x]);
end;
Doublette;
end;
end;