| 168 |
while true do |
while true do |
| 169 |
begin |
begin |
| 170 |
s := GetStrings(X + m * i, Y + n * i); |
s := GetStrings(X + m * i, Y + n * i); |
| 171 |
|
if s = stEffect then |
| 172 |
|
for j := 0 to List.Count-1 do |
| 173 |
|
if List[j] <> nil then |
| 174 |
|
begin |
| 175 |
|
q:=List[j]; |
| 176 |
|
s:=q^.Stone; |
| 177 |
|
break; |
| 178 |
|
end; |
| 179 |
if (s = stNone) or (s = stError) then |
if (s = stNone) or (s = stError) then |
| 180 |
break |
break |
| 181 |
else if s = Stone then |
else if s = Stone then |
| 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); |