omgnomorenames
2012-09-07 15:03:11
Getting [Error] (1:1): Variable Expected at line 0
I know it's probable something simple, but i can't seem to find it…
I know it's probable something simple, but i can't seem to find it…
program new;
var
Board :Array [0..8] of Array [0..8] of Integer;
Lines :Array[0..8] of String;
Count1,Count2 :Integer;
Function RowColumnBox (var RowColumn:Integer):Integer;
Begin
if (RowColumn > 5) then
Begin
Result:= 2;
end else if (RowColumn > 2) then begin
Result:= 1;
end else
Result := 0;
End;
Function CheckDigit (var Row, Column:Integer):Boolean;
var Count,Count2:Integer;
Begin
Result := True;
For Count:= 0 to 8 do
Begin
if (Board[Row][Column] = Board [Count][Column]) and not(count = Row) then
Begin
Result:= False;
Exit;
End;
if (Board[Row][Column] = Board [Row][Count]) and not(Count = Column) then
Begin
Result:= False;
Exit;
End;
End;
For Count:= (RowColumnBox(Row)*3) to (RowColumnBox(Row)*3 + 2) do
For Count2 := (RowColumnBox(Column)*3) to (RowColumnBox(Column)*3 + 2) do
Begin
if (Board[Count][Count2] = Board[Row][Column]) and not((Count = Row) and (Count2 = Column)) then
Result := False;
Exit;
End;
End;
Function FindDigit (var Row,Column: Integer):Boolean;
var Count:Integer;
Begin
Result:=False;
if (Column > 8) then
Begin
Inc(Row);
Column := 0;
if (Row > 8) then
Begin
Result:= True;
Exit;
End;
End;
if not(Board[Row][Column] = 0)then
Begin
Result := FindDigit(Row,Column+1);
End Else Begin
For Count := 1 to 9 do
Begin
Board[Row][Column]:=Count;
if (CheckDigit) then
if (FindDigit(Row,Column+1))then
Begin
Result:=True;
Exit;
End;
End;
Board[Row][Column]:=0;
End;
End;
begin
Board[0]:=[0,0,0,0,0,0,0,0,0];
Board[1]:=[0,0,0,0,0,0,0,0,0];
Board[2]:=[0,0,0,0,0,0,0,0,0];
Board[3]:=[0,0,0,0,0,0,0,0,0];
Board[4]:=[0,0,0,0,0,0,0,0,0];
Board[5]:=[0,0,0,0,0,0,0,0,0];
Board[6]:=[0,0,0,0,0,0,0,0,0];
Board[7]:=[0,0,0,0,0,0,0,0,0];
Board[8]:=[0,0,0,0,0,0,0,0,0];
FindDigit[0,0];
for Count1 := 0 to 8 do
for Count2 := 0 to 8 do
Begin
Lines [Count1] := '|'+ToStr (Board[count1][count2])+'|';
End;
for Count1 := 0 to 8 do
writeln (Lines[Count1]);
end.