Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- procedure TOXOForm.OXOGridClick(Sender: TObject);
- var Grid : array [1..3, 1..3] of Integer;
- begin
- MovesMade := MovesMade + 1;
- if OXOGrid.Cells[OXOGrid.col, OXOGrid.row] = '' then
- begin
- OXOGrid.Cells[OXOGrid.col, OXOGrid.row] := CurrentSymbol;
- if CurrentSymbol = 'X' then
- CurrentSymbol := 'O'
- else if CurrentSymbol = 'O' then
- CurrentSymbol := 'X';
- if Won then
- begin
- Resultlbl.Caption := CurrentSymbol + ' has won';
- Resultlbl.Visible := true;
- OXOGrid.Enabled := false;
- if CurrentSymbol = 'X' then
- begin
- XScore := XScore + 1;
- Label1.Caption := 'X Score: ' + inttostr(XScore);
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement