6 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
\r
7 System.Classes, Vcl.Graphics,
\r
8 Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Vcl.Buttons, Vcl.StdCtrls;
\r
11 TState = (MARU, PEKE, KARA);
\r
13 TLine = array [0 .. 2] of TSpeedButton;
\r
15 TForm1 = class(TForm)
\r
16 SpeedButton1: TSpeedButton;
\r
17 SpeedButton2: TSpeedButton;
\r
18 SpeedButton3: TSpeedButton;
\r
20 SpeedButton4: TSpeedButton;
\r
21 SpeedButton5: TSpeedButton;
\r
22 SpeedButton6: TSpeedButton;
\r
23 SpeedButton7: TSpeedButton;
\r
24 SpeedButton8: TSpeedButton;
\r
25 SpeedButton9: TSpeedButton;
\r
29 SpeedButton10: TSpeedButton;
\r
31 RadioButton1: TRadioButton;
\r
32 RadioButton2: TRadioButton;
\r
33 procedure FormCreate(Sender: TObject);
\r
34 procedure SpeedButton1Click(Sender: TObject);
\r
35 procedure SpeedButton10Click(Sender: TObject);
\r
36 procedure Timer1Timer(Sender: TObject);
\r
39 List: array [0 .. 7] of TLine;
\r
41 function Check(const Bool: Boolean = true): Boolean;
\r
43 function Hantei: integer;
\r
56 procedure TForm1.AI;
\r
65 with Self.FindComponent(Format('SpeedButton%d', [i])) as TSpeedButton do
\r
67 if Tag = Ord(KARA) then
\r
72 if Check(false) = true then
\r
75 Showmessage('LOSE');
\r
88 with Self.FindComponent(Format('SpeedButton%d', [j])) as TSpeedButton do
\r
96 function TForm1.Check(const Bool: Boolean): Boolean;
\r
101 function local(A: TState): Boolean;
\r
107 if List[i][j].Tag <> Ord(A) then
\r
114 for i := 0 to High(List) do
\r
116 if List[i][j].Tag = Ord(KARA) then
\r
118 for i := 0 to High(List) do
\r
119 if local(MARU) = true then
\r
121 for i := 0 to High(List) do
\r
122 if local(PEKE) = true then
\r
127 if (s <> '') and (Bool = true) then
\r
134 procedure TForm1.FormCreate(Sender: TObject);
\r
146 List[i][j] := Self.FindComponent(Format('SpeedButton%d', [k]))
\r
157 List[i][j] := Self.FindComponent(Format('SpeedButton%d', [k + j * 3]))
\r
163 List[6][0] := SpeedButton1;
\r
164 List[6][1] := SpeedButton5;
\r
165 List[6][2] := SpeedButton9;
\r
166 List[7][0] := SpeedButton7;
\r
167 List[7][1] := SpeedButton5;
\r
168 List[7][2] := SpeedButton3;
\r
172 function TForm1.Hantei: integer;
\r
180 for i := 0 to High(List) do
\r
185 case List[i][j].Tag of
\r
201 procedure TForm1.SpeedButton10Click(Sender: TObject);
\r
206 procedure TForm1.SpeedButton1Click(Sender: TObject);
\r
208 if player = false then
\r
210 with Sender as TSpeedButton do
\r
212 if Tag = Ord(KARA) then
\r
222 procedure TForm1.Start;
\r
227 for i := 0 to High(List) do
\r
234 player := RadioButton1.Checked;
\r
237 procedure TForm1.Timer1Timer(Sender: TObject);
\r
259 if (x = true) and (y = true) then
\r
260 Showmessage('LOSE');
\r
262 procedure test(A: Boolean);
\r
272 if List[i][j].Tag = m then
\r
279 if player = false then
\r
283 for i := 0 to High(List) do
\r