| 39 |
FTurnIndex: integer; |
FTurnIndex: integer; |
| 40 |
FActive: Boolean; |
FActive: Boolean; |
| 41 |
List: TList; |
List: TList; |
| 42 |
|
FEffectStone: TStoneType; |
| 43 |
FBool: Boolean; |
FBool: Boolean; |
| 44 |
FIndex_X: integer; |
FIndex_X: integer; |
| 45 |
FIndex_Y: integer; |
FIndex_Y: integer; |
| 134 |
begin |
begin |
| 135 |
if CanSetStone(Stone, X, Y, true) = true then |
if CanSetStone(Stone, X, Y, true) = true then |
| 136 |
begin |
begin |
| 137 |
if Stone = stBlack then |
case Stone of |
| 138 |
Stone := stWhite |
stBlack: |
| 139 |
else |
Stone := stWhite; |
| 140 |
|
stWhite: |
| 141 |
Stone := stBlack; |
Stone := stBlack; |
| 142 |
|
stEffect: |
| 143 |
|
Stone := FEffectStone; |
| 144 |
|
end; |
| 145 |
result := 0; |
result := 0; |
| 146 |
for i := 0 to Count - 1 do |
for i := 0 to Count - 1 do |
| 147 |
for j := 0 to Count - 1 do |
for j := 0 to Count - 1 do |
| 173 |
while true do |
while true do |
| 174 |
begin |
begin |
| 175 |
s := GetStrings(X + m * i, Y + n * i); |
s := GetStrings(X + m * i, Y + n * i); |
| 176 |
|
if s = stEffect then |
| 177 |
|
s:=FEffectStone; |
| 178 |
if (s = stNone) or (s = stError) then |
if (s = stNone) or (s = stError) then |
| 179 |
break |
break |
| 180 |
else if s = Stone then |
else if s = Stone then |
| 190 |
Form1.PaintBox1.Repaint; |
Form1.PaintBox1.Repaint; |
| 191 |
if Visible = true then |
if Visible = true then |
| 192 |
begin |
begin |
| 193 |
|
FEffectStone:=Stone; |
| 194 |
New(q); |
New(q); |
| 195 |
q^.Left := X + m * j; |
q^.Left := X + m * j; |
| 196 |
q^.Top := Y + n * j; |
q^.Top := Y + n * j; |
| 199 |
q^.Y := 0; |
q^.Y := 0; |
| 200 |
List.Add(q); |
List.Add(q); |
| 201 |
SetStrings(q^.Left, q^.Top, stEffect); |
SetStrings(q^.Left, q^.Top, stEffect); |
| 202 |
for k := 1 to 10 do |
for k := 1 to 100 do |
| 203 |
begin |
begin |
| 204 |
Sleep(10); |
Sleep(1); |
| 205 |
Application.ProcessMessages; |
Application.ProcessMessages; |
| 206 |
end; |
end; |
| 207 |
end |
end |
| 433 |
m: integer; |
m: integer; |
| 434 |
n: integer; |
n: integer; |
| 435 |
begin |
begin |
| 436 |
|
for i := 0 to Count - 1 do |
| 437 |
|
for j := 0 to Count - 1 do |
| 438 |
|
if StoneGrid.CanSetStone(Index.Stone, i, j, false) = true then |
| 439 |
|
begin |
| 440 |
|
result := true; |
| 441 |
|
Exit; |
| 442 |
|
end; |
| 443 |
result := false; |
result := false; |
|
with StoneGrid do |
|
|
for i := 0 to Count - 1 do |
|
|
for j := 0 to Count - 1 do |
|
|
if CanSetStone(Index.Stone, i, j, false) = true then |
|
|
begin |
|
|
for m := 0 to Count - 1 do |
|
|
for n := 0 to Count - 1 do |
|
|
if GetStrings(m, n) <> Index.Stone then |
|
|
begin |
|
|
result := true; |
|
|
Exit; |
|
|
end; |
|
|
result := false; |
|
|
end; |
|
| 444 |
end; |
end; |
| 445 |
|
|
| 446 |
begin |
begin |
| 450 |
Main; |
Main; |
| 451 |
if Execute = false then |
if Execute = false then |
| 452 |
begin |
begin |
|
Timer1.Enabled := false; |
|
| 453 |
StoneGrid.Pause; |
StoneGrid.Pause; |
| 454 |
m := 0; |
m := 0; |
| 455 |
n := 0; |
n := 0; |
| 500 |
procedure TForm1.MenuItem10Click(Sender: TObject); |
procedure TForm1.MenuItem10Click(Sender: TObject); |
| 501 |
begin |
begin |
| 502 |
StoneGrid.Restart; |
StoneGrid.Restart; |
|
Timer1.Enabled := true; |
|
| 503 |
end; |
end; |
| 504 |
|
|
| 505 |
procedure TForm1.MenuItem11Click(Sender: TObject); |
procedure TForm1.MenuItem11Click(Sender: TObject); |
| 536 |
begin |
begin |
| 537 |
Player1.Auto := MenuItem6.IsChecked; |
Player1.Auto := MenuItem6.IsChecked; |
| 538 |
Player2.Auto := MenuItem7.IsChecked; |
Player2.Auto := MenuItem7.IsChecked; |
|
MenuItem10Click(Sender); |
|
| 539 |
end; |
end; |
| 540 |
|
|
| 541 |
procedure TForm1.MenuItem8Click(Sender: TObject); |
procedure TForm1.MenuItem8Click(Sender: TObject); |
| 547 |
var |
var |
| 548 |
i, j: integer; |
i, j: integer; |
| 549 |
begin |
begin |
| 550 |
|
if StoneGrid.Active = false then |
| 551 |
|
StoneGrid.Paint(Canvas); |
| 552 |
for i := 0 to Count - 1 do |
for i := 0 to Count - 1 do |
| 553 |
begin |
begin |
| 554 |
for j := 0 to Count - 1 do |
for j := 0 to Count - 1 do |
| 577 |
PointF(Count * Size, Count * Size), 1); |
PointF(Count * Size, Count * Size), 1); |
| 578 |
Canvas.DrawLine(PointF(0, Count * Size), |
Canvas.DrawLine(PointF(0, Count * Size), |
| 579 |
PointF(Count * Size, Count * Size), 1); |
PointF(Count * Size, Count * Size), 1); |
|
if StoneGrid.Active = false then |
|
|
StoneGrid.Paint(Canvas); |
|
| 580 |
end; |
end; |
| 581 |
|
|
| 582 |
procedure TForm1.PaintBox1Resize(Sender: TObject); |
procedure TForm1.PaintBox1Resize(Sender: TObject); |
| 620 |
procedure TForm1.Timer1Timer(Sender: TObject); |
procedure TForm1.Timer1Timer(Sender: TObject); |
| 621 |
begin |
begin |
| 622 |
if (StoneGrid.Active = true) and (Index.Auto = true) then |
if (StoneGrid.Active = true) and (Index.Auto = true) then |
|
begin |
|
|
Timer1.Enabled := false; |
|
| 623 |
CompStone; |
CompStone; |
|
Timer1.Enabled := true; |
|
|
end; |
|
| 624 |
end; |
end; |
| 625 |
|
|
| 626 |
procedure TForm1.Timer2Timer(Sender: TObject); |
procedure TForm1.Timer2Timer(Sender: TObject); |