| 38 |
FTurnNumber: integer; |
FTurnNumber: integer; |
| 39 |
FTurnIndex: integer; |
FTurnIndex: integer; |
| 40 |
FActive: Boolean; |
FActive: Boolean; |
| 41 |
List: TList; |
FList: TList; |
| 42 |
FEffectStone: TStoneType; |
FEffectStone: TStoneType; |
| 43 |
FBool: Boolean; |
FBool: Boolean; |
| 44 |
FTerminated: Boolean; |
FTerminated: Boolean; |
| 105 |
procedure MenuItem10Click(Sender: TObject); |
procedure MenuItem10Click(Sender: TObject); |
| 106 |
procedure MenuItem11Click(Sender: TObject); |
procedure MenuItem11Click(Sender: TObject); |
| 107 |
procedure Timer2Timer(Sender: TObject); |
procedure Timer2Timer(Sender: TObject); |
| 108 |
|
procedure FormDeactivate(Sender: TObject); |
| 109 |
|
procedure FormActivate(Sender: TObject); |
| 110 |
private |
private |
| 111 |
{ Private 宣言 } |
{ Private 宣言 } |
| 112 |
StoneGrid: TStoneGrid; |
StoneGrid: TStoneGrid; |
| 200 |
q^.Stone := Stone; |
q^.Stone := Stone; |
| 201 |
q^.X := 0; |
q^.X := 0; |
| 202 |
q^.Y := 0; |
q^.Y := 0; |
| 203 |
List.Add(q); |
FList.Add(q); |
| 204 |
SetStrings(q^.Left, q^.Top, stEffect); |
SetStrings(q^.Left, q^.Top, stEffect); |
| 205 |
for k := 1 to 100 do |
for k := 1 to 100 do |
| 206 |
begin |
begin |
| 251 |
var |
var |
| 252 |
i, j: integer; |
i, j: integer; |
| 253 |
begin |
begin |
| 254 |
|
for i := 0 to FList.Count - 1 do |
| 255 |
|
Dispose(FList[i]); |
| 256 |
|
FList.Clear; |
| 257 |
for i := 0 to Count - 1 do |
for i := 0 to Count - 1 do |
| 258 |
for j := 0 to Count - 1 do |
for j := 0 to Count - 1 do |
| 259 |
Strings[i, j] := stNone; |
Strings[i, j] := stNone; |
| 269 |
constructor TStoneGrid.Create; |
constructor TStoneGrid.Create; |
| 270 |
begin |
begin |
| 271 |
inherited; |
inherited; |
| 272 |
List := TList.Create; |
FList := TList.Create; |
| 273 |
end; |
end; |
| 274 |
|
|
| 275 |
destructor TStoneGrid.Destroy; |
destructor TStoneGrid.Destroy; |
| 276 |
var |
var |
| 277 |
i: integer; |
i: integer; |
| 278 |
begin |
begin |
| 279 |
for i := 0 to List.Count - 1 do |
for i := 0 to FList.Count - 1 do |
| 280 |
Dispose(List[i]); |
Dispose(FList[i]); |
| 281 |
List.Free; |
FList.Free; |
| 282 |
inherited; |
inherited; |
| 283 |
end; |
end; |
| 284 |
|
|
| 301 |
p: ^TEffectData; |
p: ^TEffectData; |
| 302 |
i: integer; |
i: integer; |
| 303 |
begin |
begin |
| 304 |
if List.Count = 0 then |
if FList.Count = 0 then |
| 305 |
result := false |
result := false |
| 306 |
else |
else |
| 307 |
begin |
begin |
| 308 |
for i := 0 to List.Count - 1 do |
for i := 0 to FList.Count - 1 do |
| 309 |
begin |
begin |
| 310 |
p := List.List[i]; |
p := FList[i]; |
| 311 |
if p^.X < FIndex_X - 1 then |
if p^.X < FIndex_X - 1 then |
| 312 |
p^.X := p^.X + 1 |
p^.X := p^.X + 1 |
| 313 |
else if p^.Y < FIndex_Y - 1 then |
else if p^.Y < FIndex_Y - 1 then |
| 319 |
begin |
begin |
| 320 |
SetStrings(p^.Left, p^.Top, p^.Stone); |
SetStrings(p^.Left, p^.Top, p^.Stone); |
| 321 |
Dispose(p); |
Dispose(p); |
| 322 |
List[i] := nil; |
FList[i] := nil; |
| 323 |
end; |
end; |
| 324 |
end; |
end; |
| 325 |
for i := List.Count - 1 downto 0 do |
for i := FList.Count - 1 downto 0 do |
| 326 |
if List[i] = nil then |
if FList[i] = nil then |
| 327 |
List.Delete(i); |
FList.Delete(i); |
| 328 |
if List.Count = 0 then |
if FList.Count = 0 then |
| 329 |
begin |
begin |
| 330 |
if FTerminated = true then |
if FTerminated = true then |
| 331 |
FActive := false |
FActive := false |
| 368 |
m := Form1.Image3.Bitmap.Width; |
m := Form1.Image3.Bitmap.Width; |
| 369 |
n := Form1.Image3.Bitmap.Height; |
n := Form1.Image3.Bitmap.Height; |
| 370 |
k := Form1.Size; |
k := Form1.Size; |
| 371 |
for i := 0 to List.Count - 1 do |
for i := 0 to FList.Count - 1 do |
| 372 |
begin |
begin |
| 373 |
p := List[i]; |
p := FList[i]; |
| 374 |
if p^.Stone = stBlack then |
if p^.Stone = stBlack then |
| 375 |
s := Form1.Image1.Bitmap |
s := Form1.Image1.Bitmap |
| 376 |
else |
else |
| 417 |
|
|
| 418 |
procedure TStoneGrid.Start; |
procedure TStoneGrid.Start; |
| 419 |
begin |
begin |
|
FActive := false; |
|
| 420 |
Clear; |
Clear; |
| 421 |
FTerminated := false; |
FTerminated := false; |
| 422 |
FActive := true; |
FActive := true; |
| 458 |
end; |
end; |
| 459 |
|
|
| 460 |
begin |
begin |
| 461 |
Timer1.Enabled := false; |
Timer1.Enabled:=false; |
| 462 |
Main; |
Main; |
| 463 |
if Execute = false then |
if Execute = false then |
| 464 |
begin |
begin |
| 491 |
end |
end |
| 492 |
else |
else |
| 493 |
Caption := s; |
Caption := s; |
| 494 |
Timer1.Enabled := true; |
Timer1.Enabled:=true; |
| 495 |
end; |
end; |
| 496 |
|
|
| 497 |
procedure TForm1.CompStone; |
procedure TForm1.CompStone; |
| 506 |
|
|
| 507 |
procedure TForm1.GameStart; |
procedure TForm1.GameStart; |
| 508 |
begin |
begin |
| 509 |
|
Timer1.Enabled:=false; |
| 510 |
Index := Player1; |
Index := Player1; |
| 511 |
StoneGrid.Start; |
StoneGrid.Start; |
| 512 |
PaintBox1.Repaint; |
PaintBox1.Repaint; |
| 513 |
Caption := '黒から始めます'; |
Caption := '黒から始めます'; |
| 514 |
|
Timer1.Enabled:=true; |
| 515 |
end; |
end; |
| 516 |
|
|
| 517 |
procedure TForm1.MenuItem10Click(Sender: TObject); |
procedure TForm1.MenuItem10Click(Sender: TObject); |
| 601 |
Size := Min(ClientWidth, ClientHeight) div Count; |
Size := Min(ClientWidth, ClientHeight) div Count; |
| 602 |
end; |
end; |
| 603 |
|
|
| 604 |
|
procedure TForm1.FormActivate(Sender: TObject); |
| 605 |
|
begin |
| 606 |
|
Timer1.Enabled := true; |
| 607 |
|
end; |
| 608 |
|
|
| 609 |
procedure TForm1.FormCreate(Sender: TObject); |
procedure TForm1.FormCreate(Sender: TObject); |
| 610 |
begin |
begin |
| 611 |
StoneGrid := TStoneGrid.Create; |
StoneGrid := TStoneGrid.Create; |
| 626 |
GameStart; |
GameStart; |
| 627 |
end; |
end; |
| 628 |
|
|
| 629 |
|
procedure TForm1.FormDeactivate(Sender: TObject); |
| 630 |
|
begin |
| 631 |
|
Timer1.Enabled := false; |
| 632 |
|
end; |
| 633 |
|
|
| 634 |
procedure TForm1.FormDestroy(Sender: TObject); |
procedure TForm1.FormDestroy(Sender: TObject); |
| 635 |
begin |
begin |
| 636 |
StoneGrid.Free; |
StoneGrid.Free; |