I REALLY need some help. I ahve been writing a tic-tac-toe console application program in delphi. I had most of the logic finished for the program when I made a mistake. At the beginning of a class period the program was working fine, at the end of the class it had an error. At some point in my program I must have added an extra END;. I am unable to find this extra end (even though I might have just missed it). I was wondering if Delphi has any properties similar to the new VB where you can see which end matches up to each begin. Here is the current code for my program

program TICTACTOE;
{$APPTYPE CONSOLE}
uses
  SysUtils;

Var
Win,SaveMove,MoveTaken: Boolean;
Board: Array [1..3,1..3] of integer;
Choice,ComputerChoice,FinalChoice: Integer;
begin
{Austin Schroeder}

Randomize   ;
Win := False;
While Win = False do
begin
MoveTaken:= True;

While MoveTaken = True do
begin
If Choice = 0 then
Begin
writeln('   |   |   ');
writeln('   |   |   ');
writeln('   |   |   ');
writeln('---|---|---');
writeln('   |   |   ');
writeln('   |   |   ');
writeln('   |   |   ');
writeln('---|---|---');
writeln('   |   |   ');
writeln('   |   |   ');
writeln('   |   |   ');
end;
writeln('Select Placement (Top Left = 1, Top Middle = 2, and so on)');
Readln(Choice);
     If Board[1][1] = 0 Then
     begin
        If Choice = 1 Then
        begin
        Board[1][1]:= 3;
        writeln('\ /|   |   ');
        writeln(' \ |   |   ');
        writeln('/ \|   |   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        end;
        end;

        If Board[1][2] = 0 Then
        begin
        If Choice = 2 Then
        begin
        Board[1][2]:= 3;
        writeln('   |\ /|   ');
        writeln('   | \ |   ');
        writeln('   |/ \|   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        end;
        end;

        If Board[1][3] = 0 then
        begin
        If Choice = 3 Then
        begin
        Board[1][3]:= 3;
        writeln('   |   |\ /');
        writeln('   |   | \ ');
        writeln('   |   |/ \');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        end;
        end;

        If Board[2][1] = 0 Then
        begin
        If Choice = 4 Then
        begin
        Board[2][1]:= 3;
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('\ /|   |   ');
        writeln(' \ |   |   ');
        writeln('/ \|   |   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        end;
        end;

        if Board[2][2] = 0 then
        If Choice = 5 Then
        begin
        Board[2][2]:= 3;
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |\ /|   ');
        writeln('   | \ |   ');
        writeln('   |/ \|   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        end;
        end;

        If Board[2][3] = 0 Then
        begin
        If Choice = 6 Then
        begin
        Board[2][3]:= 3;
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |   |\ /');
        writeln('   |   | \ ');
        writeln('   |   |/ \');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        end;
        end;

        If Board[3][1] = 0 THen
        begin
        If Choice = 7 Then
        begin
        Board[3][1]:= 3;
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('\ /|   |   ');
        writeln(' \ |   |   ');
        writeln('/ \|   |   ');
        end;
        end;

        If Board[3][2] = 0 Then
        begin
        If Choice = 8 Then
        begin
        Board[3][2]:= 3;
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |\ /|   ');
        writeln('   | \ |   ');
        writeln('   |/ \|   ');
        end;
        end;

        If Board[3][3] = 0 then
        begin
        If Choice = 9 Then
        begin
        Board[3][3]:= 3;
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('   |   |   ');
        writeln('---|---|---');
        writeln('   |   |\ /');
        writeln('   |   | \ ');
        writeln('   |   |/ \');
        end;
        end;
        writeln('Sorry that spot is taken please choose again.');
        end;
         FinalChoice := Choice;
       {End of First Turn For Player}
       MoveTaken:= True;
       {Checking For Win}
       If Board[1][1] + Board[1][2] + Board[1][3] = 9 then
       begin
       Writeln('Player Won');
       Win := True;
       end;
       If Board[2][1] + Board[2][2] + Board[2][3] = 9 then
       begin
       Writeln('Player Won');
       Win := True;
       end;
       If Board[3][1] + Board[3][2] + Board[3][3] = 9 then
       begin
       Writeln('Player Won');
       Win := True;
       end;
       If Board[1][1] + Board[2][1] + Board[3][1] = 9 then
       begin
       Writeln('Player Won');
       Win := True;
       end;
       If Board[1][2] + Board[2][2] + Board[3][2] = 9 then
       begin
       Writeln('Player Won');
       Win := True;
       end;
       If Board[1][3] + Board[2][3] + Board[3][3] = 9 then
       begin
       Writeln('Player Won');
       Win := True;
       end;
       If Board[1][1] + Board[2][2] + Board[3][3] = 9 then
       begin
       Writeln('Player Won');
       Win := True;
       end;
       If Board[1][3] + Board[2][2] + Board[3][1] = 9 then
       begin
       Writeln('Player Won');
       Win := True;
       end;
       {cheking For Computer Potential Winning Spot}
       {Right Horizontal}
       If Win = False Then
       begin
       If Board[1][1] + Board[1][2] = 10 then
       begin
       ComputerChoice:= 3;
       Board[1][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][1] + Board[2][2] = 10 Then
       begin
       ComputerChoice:= 6;
       Board[2][3] := 5;
       FinalChoice := Choice +1;
       End;

       If Board[3][1] + Board[3][2] = 10 then
       begin
       ComputerChoice:= 9;
       Board[3][3]:= 5;
       FinalChoice := Choice +1;
       end;

       {Middle Horizontal}
       If Board[1][1] + Board[1][3] = 10 then
       begin
       ComputerChoice:= 2;
       Board[1][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][1] + Board[2][3] = 10 then
       begin
       ComputerChoice:= 5;
       Board[2][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[3][1] + Board[3][3] = 10 then
       begin
       ComputerChoice:= 8;
       Board[3][2]:= 5;
       FinalChoice := Choice +1;
       end;

       {Left Horizontal}
       If Board[1][2] + Board[1][3] = 10 then
       begin
       ComputerChoice:= 1;
       Board[1][1]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][2] + Board[2][3] = 10 then
       begin
       ComputerChoice:= 4;
       Board[2][1]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[3][2] + Board[3][3] = 10 then
       begin
       ComputerChoice:= 7;
       Board[3][1]:= 5;
       FinalChoice := Choice +1;
       end;

       {Bottom Vertical}
       If Board[1][1] + Board[2][1] = 10 then
       begin
       ComputerChoice:= 7;
       Board[3][1]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][2] + Board[2][2] = 10 then
       begin
       ComputerChoice:= 8;
       Board[3][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][3] + Board[2][3] = 10 then
       begin
       ComputerChoice:= 9;
       Board[3][3]:= 5;
       FinalChoice := Choice +1;
       end;

       {Middle Vertical}
       If Board[1][3] + Board[3][3] = 10 then
       begin
       ComputerChoice:= 6;
       Board[2][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][2] + Board[3][2] = 10 then
       begin
       ComputerChoice:= 5;
       Board[2][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][1] + Board[3][1] = 10 then
       begin
       ComputerChoice:= 4;
       Board[2][1]:= 5;
       FinalChoice := Choice +1;
       end;

       {Top Vertical}
       If Board[2][3] + Board[3][3] = 10 then
       begin
       ComputerChoice:= 3;
       Board[1][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][2] + Board[3][2] = 10 then
       begin
       ComputerChoice:= 2;
       Board[1][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][1] + Board[3][1] = 10 then
       begin
       ComputerChoice:= 1;
       Board[1][1]:= 5;
       FinalChoice := Choice +1;
       end;

       {Diagonol Top Left-Bottom Right}
       If Board[1][1] + Board[2][2] = 10 then
       begin
       ComputerChoice:= 9;
       Board[3][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][1] + Board[3][3] = 10 then
       begin
       ComputerChoice:= 5;
       Board[2][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][2] + Board[3][3] = 10 then
       begin
       ComputerChoice:= 1;
       Board[1][1]:= 5;
       FinalChoice := Choice +1;
       end;

       {Diagonol Top Right-Bottom Left}
       If Board[1][3] + Board[2][2] = 10 then
       begin
       ComputerChoice:= 7;
       Board[3][1]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][3] + Board[3][1] = 10 then
       begin
       ComputerChoice:= 5;
       Board[2][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][2] + Board[3][1] = 10 then
       begin
       ComputerChoice:= 3;
       Board[1][3]:= 5;
       FinalChoice := Choice +1;
       end;

       {End of Checking For Computer Winning Spot}


       {Player Potential Winning Spot}
       {Right Horizontal}
       If Board[1][1] + Board[1][2] = 6 then
       begin
       ComputerChoice:= 3;
       Board[1][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][1] + Board[2][2] = 6 Then
       begin
       ComputerChoice:= 6;
       Board[2][3] := 5;
       FinalChoice := Choice +1;
       End;

       If Board[3][1] + Board[3][2] = 6 then
       begin
       ComputerChoice:= 9;
       Board[3][3]:= 5;
       FinalChoice := Choice +1;
       end;

       {Middle Horizontal}
       If Board[1][1] + Board[1][3] = 6 then
       begin
       ComputerChoice:= 2;
       Board[1][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][1] + Board[2][3] = 6 then
       begin
       ComputerChoice:= 5;
       Board[2][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[3][1] + Board[3][3] = 6 then
       begin
       ComputerChoice:= 8;
       Board[3][2]:= 5;
       FinalChoice := Choice +1;
       end;

       {Left Horizontal}
       If Board[1][2] + Board[1][3] = 6 then
       begin
       ComputerChoice:= 1;
       Board[1][1]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][2] + Board[2][3] = 6 then
       begin
       ComputerChoice:= 4;
       Board[2][1]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[3][2] + Board[3][3] = 6 then
       begin
       ComputerChoice:= 7;
       Board[3][1]:= 5;
       FinalChoice := Choice +1;
       end;

       {Bottom Vertical}
       If Board[1][1] + Board[2][1] = 6 then
       begin
       ComputerChoice:= 7;
       Board[3][1]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][2] + Board[2][2] = 6 then
       begin
       ComputerChoice:= 8;
       Board[3][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][3] + Board[2][3] = 6 then
       begin
       ComputerChoice:= 9;
       Board[3][3]:= 5;
       FinalChoice := Choice +1;
       end;

       {Middle Vertical}
       If Board[1][3] + Board[3][3] = 6 then
       begin
       ComputerChoice:= 6;
       Board[2][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][2] + Board[3][2] = 6 then
       begin
       ComputerChoice:= 5;
       Board[2][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][1] + Board[3][1] = 6 then
       begin
       ComputerChoice:= 4;
       Board[2][1]:= 5;
       FinalChoice := Choice +1;
       end;

       {Top Vertical}
       If Board[2][3] + Board[3][3] = 6 then
       begin
       ComputerChoice:= 3;
       Board[1][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][2] + Board[3][2] = 6 then
       begin
       ComputerChoice:= 2;
       Board[1][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][1] + Board[3][1] = 6 then
       begin
       ComputerChoice:= 1;
       Board[1][1]:= 5;
       FinalChoice := Choice +1;
       end;

       {Diagonol Top Left-Bottom Right}
       If Board[1][1] + Board[2][2] = 6 then
       begin
       ComputerChoice:= 9;
       Board[3][3]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][1] + Board[3][3] = 6 then
       begin
       ComputerChoice:= 5;
       Board[2][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][2] + Board[3][3] = 6 then
       begin
       ComputerChoice:= 1;
       Board[1][1]:= 5;
       FinalChoice := Choice +1;
       end;

       {Diagonol Top Right-Bottom Left}
       If Board[1][3] + Board[2][2] = 6 then
       begin
       ComputerChoice:= 7;
       Board[3][1]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[1][3] + Board[3][1] = 6 then
       begin
       ComputerChoice:= 5;
       Board[2][2]:= 5;
       FinalChoice := Choice +1;
       end;

       If Board[2][2] + Board[3][1] = 6 then
       begin
       ComputerChoice:= 3;
       Board[1][3]:= 5;
       FinalChoice := Choice +1;
       end;
      {End Of Player Winning Spot Check}
      {Computer Choice Without Winning Spot}
      While FinalChoice = Choice do
      begin
      Randomize;
      ComputerChoice := 1 + Random(9);

      If ComputerChoice = 1 then
      begin
         If Board[1][1] = 0 Then
         begin
            FinalChoice:= Choice + 1;
            Board[1][1] := 5;
            end;
      end;

      If ComputerChoice = 2 then
      begin
         If Board[1][2] = 0 Then
         begin
            FinalChoice:= Choice + 1;
            Board[1][2] := 5;
            end;
      end;

      If ComputerChoice = 3 then
      begin
         If Board[1][3] = 0 Then
         begin
            FinalChoice:= Choice + 1;
            Board[1][3] := 5;
            end;
      end;

      If ComputerChoice = 4 then
      begin
         If Board[2][1] = 0 Then
         begin
            FinalChoice:= Choice + 1;
            Board[2][1] := 5;
            end;
      end;

      If ComputerChoice = 5 then
      begin
         If Board[2][2] = 0 Then
         begin
            FinalChoice:= Choice + 1;
            Board[2][2] := 5;
            end;
      end;

      If ComputerChoice = 6 then
      begin
         If Board[2][3] = 0 Then
         begin
            FinalChoice:= Choice + 1;
            Board[2][3] := 5;
            end;
      end;

      If ComputerChoice = 7 then
      begin
         If Board[3][1] = 0 Then
         begin
            FinalChoice:= Choice + 1;
            Board[3][1] := 5;
            end;
      end;

      If ComputerChoice = 8 then
      begin
         If Board[3][2] = 0 Then
         begin
            FinalChoice:= Choice + 1;
            Board[3][2] := 5;
            end;
      end;

      If ComputerChoice = 9 then
      begin
         If Board[3][3] = 0 Then
         begin
            FinalChoice:= Choice + 1;
            Board[3][3] := 5;
            end;
      end;
{Ending Random Choice While-Do}
end;
{Ending Player Win Check}
end;
{Just for me to see how the program is working until I am done with the visual potrtion of the program}
writeln('-----');
writeln(ComputerChoice);
writeln('-----');
writeln(Board[1][1]);
writeln(Board[1][2]);
writeln(Board[1][3]);
writeln(Board[2][1]);
writeln(Board[2][2]);
writeln(Board[2][3]);
writeln(Board[3][1]);
writeln(Board[3][2]);
writeln(Board[3][3]);
{Ending Major While-Do}
end;
{End Of Program}
readln
end.

I would start by adopting more consistent indentation practices; as it is, you're all over the place with your indentation. I'll try to get the code indented suitably for you so we can see where things actually lie.

program TICTACTOE;
{$APPTYPE CONSOLE}
uses
SysUtils;

var
   Win,SaveMove,MoveTaken:   Boolean;
   Board:    Array [1..3,1..3] of integer;
   Choice,ComputerChoice,FinalChoice:   Integer;

begin
   {Austin Schroeder}
   Randomize   ;
   Win :=  False;
   while Win  =  False do
   begin
      MoveTaken :=  True;

      While MoveTaken = True do
      begin
         if Choice = 0 then
         begin
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('---|---|---');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('---|---|---');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
         end;
         writeln('Select Placement (Top Left = 1, Top Middle = 2, and so on)');
         Readln(Choice);
         If Board[1][1] = 0 Then
         begin
            If Choice = 1 Then
            begin
               Board[1][1] :=  3;
               writeln('\ /|   |   ');
               writeln(' \ |   |   ');
               writeln('/ \|   |   ');
               writeln('---|---|---');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('---|---|---');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
            end;
         end;

         If Board[1][2] = 0 Then
         begin
            if Choice = 2 Then
            begin
               Board[1][2] := 3;
               writeln('   |\ /|   ');
               writeln('   | \ |   ');
               writeln('   |/ \|   ');
               writeln('---|---|---');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('---|---|---');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
            end;
         end;

         If Board[1][3] = 0 then
         begin
            If Choice = 3 Then
            begin
               Board[1][3] :=  3;
               writeln('   |   |\ /');
               writeln('   |   | \ ');
               writeln('   |   |/ \');
               writeln('---|---|---');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('---|---|---');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
            end;
         end;

         If Board[2][1] = 0 Then
         begin
            If Choice = 4 Then
            begin
               Board[2][1]:= 3;
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('---|---|---');
               writeln('\ /|   |   ');
               writeln(' \ |   |   ');
               writeln('/ \|   |   ');
               writeln('---|---|---');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
            end;
         end;

         if Board[2][2] = 0 then
            If Choice = 5 Then
            begin
               Board[2][2]:= 3;
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('---|---|---');
               writeln('   |\ /|   ');
               writeln('   | \ |   ');
               writeln('   |/ \|   ');
               writeln('---|---|---');
               writeln('   |   |   ');
               writeln('   |   |   ');
               writeln('   |   |   ');
            end;
      end;

      If Board[2][3] = 0 Then
      begin
         If Choice = 6 Then
         begin
            Board[2][3]:= 3;
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('---|---|---');
            writeln('   |   |\ /');
            writeln('   |   | \ ');
            writeln('   |   |/ \');
            writeln('---|---|---');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
         end;
      end;

      If Board[3][1] = 0 THen
      begin
         If Choice = 7 Then
         begin
            Board[3][1]:= 3;
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('---|---|---');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('---|---|---');
            writeln('\ /|   |   ');
            writeln(' \ |   |   ');
            writeln('/ \|   |   ');
         end;
      end;

      If Board[3][2] = 0 Then
      begin
         If Choice = 8 Then
         begin
            Board[3][2]:= 3;
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('---|---|---');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('---|---|---');
            writeln('   |\ /|   ');
            writeln('   | \ |   ');
            writeln('   |/ \|   ');
         end;
      end;

      If Board[3][3] = 0 then
      begin
         If Choice = 9 Then
         begin
            Board[3][3]:= 3;
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('---|---|---');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('   |   |   ');
            writeln('---|---|---');
            writeln('   |   |\ /');
            writeln('   |   | \ ');
            writeln('   |   |/ \');
         end;
      end;
      writeln('Sorry that spot is taken please choose again.');
   end;
   FinalChoice := Choice;
   {End of First Turn For Player}
   MoveTaken:= True;
   {Checking For Win}
   If Board[1][1] + Board[1][2] + Board[1][3] = 9 then
   begin
      Writeln('Player Won');
      Win := True;
   end;
   If Board[2][1] + Board[2][2] + Board[2][3] = 9 then
   begin
      Writeln('Player Won');
      Win := True;
   end;
   If Board[3][1] + Board[3][2] + Board[3][3] = 9 then
   begin
      Writeln('Player Won');
      Win := True;
   end;
   If Board[1][1] + Board[2][1] + Board[3][1] = 9 then
   begin
      Writeln('Player Won');
      Win := True;
   end;
   If Board[1][2] + Board[2][2] + Board[3][2] = 9 then
   begin
      Writeln('Player Won');
      Win := True;
   end;
   If Board[1][3] + Board[2][3] + Board[3][3] = 9 then
   begin
      Writeln('Player Won');
      Win := True;
   end;
   If Board[1][1] + Board[2][2] + Board[3][3] = 9 then
   begin
      Writeln('Player Won');
      Win := True;
   end;
   If Board[1][3] + Board[2][2] + Board[3][1] = 9 then
   begin
      Writeln('Player Won');
      Win := True;
   end;
   {cheking For Computer Potential Winning Spot}
   {Right Horizontal}
   If Win = False Then
   begin
      If Board[1][1] + Board[1][2] = 10 then
      begin
         ComputerChoice:= 3;
         Board[1][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][1] + Board[2][2] = 10 Then
      begin
         ComputerChoice:= 6;
         Board[2][3] := 5;
         FinalChoice := Choice +1;
      End;

      If Board[3][1] + Board[3][2] = 10 then
      begin
         ComputerChoice:= 9;
         Board[3][3]:= 5;
         FinalChoice := Choice +1;
      end;

      {Middle Horizontal}
      If Board[1][1] + Board[1][3] = 10 then
      begin
         ComputerChoice:= 2;
         Board[1][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][1] + Board[2][3] = 10 then
      begin
         ComputerChoice:= 5;
         Board[2][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[3][1] + Board[3][3] = 10 then
      begin
         ComputerChoice:= 8;
         Board[3][2]:= 5;
         FinalChoice := Choice +1;
      end;

      {Left Horizontal}
      If Board[1][2] + Board[1][3] = 10 then
      begin
         ComputerChoice:= 1;
         Board[1][1]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][2] + Board[2][3] = 10 then
      begin
         ComputerChoice:= 4;
         Board[2][1]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[3][2] + Board[3][3] = 10 then
      begin
         ComputerChoice:= 7;
         Board[3][1]:= 5;
         FinalChoice := Choice +1;
      end;

      {Bottom Vertical}
      If Board[1][1] + Board[2][1] = 10 then
      begin
         ComputerChoice:= 7;
         Board[3][1]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][2] + Board[2][2] = 10 then
      begin
         ComputerChoice:= 8;
         Board[3][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][3] + Board[2][3] = 10 then
      begin
         ComputerChoice:= 9;
         Board[3][3]:= 5;
         FinalChoice := Choice +1;
      end;

      {Middle Vertical}
      If Board[1][3] + Board[3][3] = 10 then
      begin
         ComputerChoice:= 6;
         Board[2][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][2] + Board[3][2] = 10 then
      begin
         ComputerChoice:= 5;
         Board[2][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][1] + Board[3][1] = 10 then
      begin
         ComputerChoice:= 4;
         Board[2][1]:= 5;
         FinalChoice := Choice +1;
      end;

      {Top Vertical}
      If Board[2][3] + Board[3][3] = 10 then
      begin
         ComputerChoice:= 3;
         Board[1][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][2] + Board[3][2] = 10 then
      begin
         ComputerChoice:= 2;
         Board[1][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][1] + Board[3][1] = 10 then
      begin
         ComputerChoice:= 1;
         Board[1][1]:= 5;
         FinalChoice := Choice +1;
      end;

      {Diagonol Top Left-Bottom Right}
      If Board[1][1] + Board[2][2] = 10 then
      begin
         ComputerChoice:= 9;
         Board[3][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][1] + Board[3][3] = 10 then
      begin
         ComputerChoice:= 5;
         Board[2][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][2] + Board[3][3] = 10 then
      begin
         ComputerChoice:= 1;
         Board[1][1]:= 5;
         FinalChoice := Choice +1;
      end;

      {Diagonol Top Right-Bottom Left}
      If Board[1][3] + Board[2][2] = 10 then
      begin
         ComputerChoice:= 7;
         Board[3][1]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][3] + Board[3][1] = 10 then
      begin
         ComputerChoice:= 5;
         Board[2][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][2] + Board[3][1] = 10 then
      begin
         ComputerChoice:= 3;
         Board[1][3]:= 5;
         FinalChoice := Choice +1;
      end;

      {End of Checking For Computer Winning Spot}


      {Player Potential Winning Spot}
      {Right Horizontal}
      If Board[1][1] + Board[1][2] = 6 then
      begin
         ComputerChoice:= 3;
         Board[1][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][1] + Board[2][2] = 6 Then
      begin
         ComputerChoice:= 6;
         Board[2][3] := 5;
         FinalChoice := Choice +1;
      End;

      If Board[3][1] + Board[3][2] = 6 then
      begin
         ComputerChoice:= 9;
         Board[3][3]:= 5;
         FinalChoice := Choice +1;
      end;

      {Middle Horizontal}
      If Board[1][1] + Board[1][3] = 6 then
      begin
         ComputerChoice:= 2;
         Board[1][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][1] + Board[2][3] = 6 then
      begin
         ComputerChoice:= 5;
         Board[2][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[3][1] + Board[3][3] = 6 then
      begin
         ComputerChoice:= 8;
         Board[3][2]:= 5;
         FinalChoice := Choice +1;
      end;

      {Left Horizontal}
      If Board[1][2] + Board[1][3] = 6 then
      begin
         ComputerChoice:= 1;
         Board[1][1]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][2] + Board[2][3] = 6 then
      begin
         ComputerChoice:= 4;
         Board[2][1]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[3][2] + Board[3][3] = 6 then
      begin
         ComputerChoice:= 7;
         Board[3][1]:= 5;
         FinalChoice := Choice +1;
      end;

      {Bottom Vertical}
      If Board[1][1] + Board[2][1] = 6 then
      begin
         ComputerChoice:= 7;
         Board[3][1]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][2] + Board[2][2] = 6 then
      begin
         ComputerChoice:= 8;
         Board[3][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][3] + Board[2][3] = 6 then
      begin
         ComputerChoice:= 9;
         Board[3][3]:= 5;
         FinalChoice := Choice +1;
      end;

      {Middle Vertical}
      If Board[1][3] + Board[3][3] = 6 then
      begin
         ComputerChoice:= 6;
         Board[2][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][2] + Board[3][2] = 6 then
      begin
         ComputerChoice:= 5;
         Board[2][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][1] + Board[3][1] = 6 then
      begin
         ComputerChoice:= 4;
         Board[2][1]:= 5;
         FinalChoice := Choice +1;
      end;

      {Top Vertical}
      If Board[2][3] + Board[3][3] = 6 then
      begin
         ComputerChoice:= 3;
         Board[1][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][2] + Board[3][2] = 6 then
      begin
         ComputerChoice:= 2;
         Board[1][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][1] + Board[3][1] = 6 then
      begin
         ComputerChoice:= 1;
         Board[1][1]:= 5;
         FinalChoice := Choice +1;
      end;

      {Diagonol Top Left-Bottom Right}
      If Board[1][1] + Board[2][2] = 6 then
      begin
         ComputerChoice:= 9;
         Board[3][3]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][1] + Board[3][3] = 6 then
      begin
         ComputerChoice:= 5;
         Board[2][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][2] + Board[3][3] = 6 then
      begin
         ComputerChoice:= 1;
         Board[1][1]:= 5;
         FinalChoice := Choice +1;
      end;

      {Diagonol Top Right-Bottom Left}
      If Board[1][3] + Board[2][2] = 6 then
      begin
         ComputerChoice:= 7;
         Board[3][1]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[1][3] + Board[3][1] = 6 then
      begin
         ComputerChoice:= 5;
         Board[2][2]:= 5;
         FinalChoice := Choice +1;
      end;

      If Board[2][2] + Board[3][1] = 6 then
      begin
         ComputerChoice:= 3;
         Board[1][3]:= 5;
         FinalChoice := Choice +1;
      end;
      {End Of Player Winning Spot Check}
      {Computer Choice Without Winning Spot}
      While FinalChoice = Choice do
      begin
         Randomize;
         ComputerChoice := 1 + Random(9);

         If ComputerChoice = 1 then
         begin
            If Board[1][1] = 0 Then
            begin
               FinalChoice:= Choice + 1;
               Board[1][1] := 5;
            end;
         end;

         If ComputerChoice = 2 then
         begin
            If Board[1][2] = 0 Then
            begin
               FinalChoice:= Choice + 1;
               Board[1][2] := 5;
            end;
         end;

         If ComputerChoice = 3 then
         begin
            If Board[1][3] = 0 Then
            begin
               FinalChoice:= Choice + 1;
               Board[1][3] := 5;
            end;
         end;

         If ComputerChoice = 4 then
         begin
            If Board[2][1] = 0 Then
            begin
               FinalChoice:= Choice + 1;
               Board[2][1] := 5;
            end;
         end;

         If ComputerChoice = 5 then
         begin
            If Board[2][2] = 0 Then
            begin
               FinalChoice:= Choice + 1;
               Board[2][2] := 5;
            end;
         end;

         If ComputerChoice = 6 then
         begin
            If Board[2][3] = 0 Then
            begin
               FinalChoice:= Choice + 1;
               Board[2][3] := 5;
            end;
         end;

         If ComputerChoice = 7 then
         begin
            If Board[3][1] = 0 Then
            begin
               FinalChoice:= Choice + 1;
               Board[3][1] := 5;
            end;
         end;

         If ComputerChoice = 8 then
         begin
            If Board[3][2] = 0 Then
            begin
               FinalChoice:= Choice + 1;
               Board[3][2] := 5;
            end;
         end;

         If ComputerChoice = 9 then
         begin
            If Board[3][3] = 0 Then
            begin
               FinalChoice:= Choice + 1;
               Board[3][3] := 5;
            end;
         end;
         {Ending Random Choice While-Do}
      end;
      {Ending Player Win Check}
   end;
   {Just for me to see how the program is working until I am done with the visual portion of the program}
   writeln('-----');
   writeln(ComputerChoice);
   writeln('-----');
   writeln(Board[1][1]);
   writeln(Board[1][2]);
   writeln(Board[1][3]);
   writeln(Board[2][1]);
   writeln(Board[2][2]);
   writeln(Board[2][3]);
   writeln(Board[3][1]);
   writeln(Board[3][2]);
   writeln(Board[3][3]);
   {Ending Major While-Do}
end;
{End Of Program}
readln
end.

Aside from the formatting issues (which I resolved automagically using the GNU Emacs' Pascal Mode auto-indent), I see some definite show-stopping problems with this code. Given your current approach to laying out the board on the screen, you would need something on the order of 350000 'screen shots' to display all the possible outcomes of a game. You are going to have to find some way of generating the screens programmatically. I would start by simplfying the issue, using a simpler display matrix rather than the multi-column approach you are now using, something like this:

   | o | 
---+---+---
 o | x | x
---+---+---
   |   |

This would be much easier to write a generating code for, as you would be able to write an 'x' or an 'o' with a single character. All you'd actually need to store is a cross-bar (---+---+---) a vertical bar (|), and a 3x3 array holding the positions of the already marked values.

program TICTACTOE;
{$APPTYPE CONSOLE}
uses
SysUtils;

const
   crossbar = '---+---+---';
   verticalbar = '|';

type
   Mark = (EMPTY, CROSS, NOUGHT);

var
   Board: array[1..3, 1..3] of Mark;

   procedure initBoard;
   var
      i, j: integer;
   begin
      for i := 1 to 3 do
      begin
         for j := 1 to 3 do
         begin
            board[i,j] := EMPTY;
         end;
      end;
   end;

   procedure drawMarks(lineNumber: Integer);
   var
      i: integer;
   begin
      for i := 1 to 3 do
      begin
         write(' ');
         case (board[lineNumber, i]) of
            EMPTY:  write(' ');
            CROSS:  write('x');
            NOUGHT: write('o');
         end;
         write(' ');
         if i < 3 then
         begin
            write(verticalbar);
         end;
      end;
      writeLn;
   end;

   procedure drawLine;
   begin
      writeln(crossbar);
   end;

   procedure drawBoard;
   begin
      drawMarks(1);
      drawLine;
      drawMarks(2);
      drawLine;
      drawMarks(3);
   end;

begin
  initBoard;
  drawBoard;
  writeln;

  board[2,3] := CROSS;
  drawBoard;

  readln;
end.  
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.