อยากให้ช่วยอธิบายโคดเหมือนคนล่างอะคับ
เอาเป็นภาษาไทยนะคับ คอมเม้นเป็นภาษาไทยนะคับผม นี่เป็นเว็บตัวนี้นะคับถ้าไม่เข้าใจอะ delphi.oflameron.com/
#############################
unit Oflameron; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls, jpeg;
type TForm1 = class(TForm) GroupBox1: TGroupBox; StaticText1: TStaticText; StaticText3: TStaticText; Timer1: TTimer; Image1: TImage; StaticText56: TStaticText; StaticText49: TStaticText; StaticText50: TStaticText; StaticText51: TStaticText; StaticText52: TStaticText; StaticText53: TStaticText; StaticText54: TStaticText; StaticText55: TStaticText; StaticText47: TStaticText; StaticText48: TStaticText; StaticText39: TStaticText; StaticText40: TStaticText; StaticText41: TStaticText; StaticText42: TStaticText; StaticText43: TStaticText; StaticText44: TStaticText; StaticText45: TStaticText; StaticText46: TStaticText; StaticText31: TStaticText; StaticText32: TStaticText; StaticText33: TStaticText; StaticText34: TStaticText; StaticText35: TStaticText; StaticText36: TStaticText; StaticText37: TStaticText; StaticText38: TStaticText; StaticText23: TStaticText; StaticText24: TStaticText; StaticText25: TStaticText; StaticText26: TStaticText; StaticText27: TStaticText; StaticText28: TStaticText; StaticText29: TStaticText; StaticText30: TStaticText; StaticText15: TStaticText; StaticText16: TStaticText; StaticText17: TStaticText; StaticText18: TStaticText; StaticText19: TStaticText; StaticText20: TStaticText; StaticText21: TStaticText; StaticText22: TStaticText; StaticText8: TStaticText; StaticText9: TStaticText; StaticText10: TStaticText; StaticText11: TStaticText; StaticText12: TStaticText; StaticText13: TStaticText; StaticText14: TStaticText; StaticText7: TStaticText; StaticText2: TStaticText; StaticText4: TStaticText; StaticText5: TStaticText; StaticText6: TStaticText; StaticText57: TStaticText; procedure FormShow(Sender: TObject); procedure StaticText6Click(Sender: TObject); procedure StaticText7Click(Sender: TObject); procedure StaticText8Click(Sender: TObject); procedure StaticText9Click(Sender: TObject); procedure StaticText10Click(Sender: TObject); procedure StaticText11Click(Sender: TObject); procedure StaticText12Click(Sender: TObject); procedure StaticText13Click(Sender: TObject); procedure StaticText14Click(Sender: TObject); procedure StaticText48Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); procedure Image1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;
var Form1: TForm1; St: systemtime; field: array[0..7, 0..5] of Integer; firstset: byte; i: byte; j: byte; IndLent: Integer; n: byte; k: Integer; lvl: Integer; vt: Integer; tk: Integer; savecolor: array[0..7] of Integer; markersave: Integer; et: Integer; implementation
{$R *.DFM} {Tutorial for beginners Delphi programmers (c) by Valery V Shmeleff Moscow/Russia 1994-2005 www.oflameron.ru and www.oflameron.com ee@oflameron.ru http://delphi.oflameron.com }
function FieldFill : integer; begin
Randomize; //StaticText7.Caption :=IntToStr(Random(20));
for i := 0 to 7 do for j := 0 to 5 do
field[i, j] :=Random(20);
end; //============================================= function Marker_Reset : integer; begin if markersave = 0 then Form1.StaticText7.Color := $00FD1117; if markersave = 1 then Form1.StaticText8.Color := $00FD1117; if markersave = 2 then Form1.StaticText9.Color := $00FD1117; if markersave = 3 then Form1.StaticText10.Color := $00FD1117; if markersave = 4 then Form1.StaticText11.Color := $00FD1117; if markersave = 5 then Form1.StaticText12.Color := $00FD1117; if markersave = 6 then Form1.StaticText13.Color := $00FD1117; if markersave = 7 then Form1.StaticText14.Color := $00FD1117; end; //============================================= function Color_Chars : integer; begin
if field[i, j] = 0 then Form1.StaticText56.Caption := '+1'; if field[i, j] = 0 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 0 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 1 then Form1.StaticText56.Caption := '-1'; if field[i, j] = 1 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 1 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 2 then Form1.StaticText56.Caption := '+5'; if field[i, j] = 2 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 2 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 3 then Form1.StaticText56.Caption := '-5'; if field[i, j] = 3 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 3 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 4 then Form1.StaticText56.Caption := '+10'; if field[i, j] = 4 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 4 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 5 then Form1.StaticText56.Caption := '-10'; if field[i, j] = 5 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 5 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 6 then Form1.StaticText56.Caption := '+15'; if field[i, j] = 6 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 6 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 7 then Form1.StaticText56.Caption := '-15'; if field[i, j] = 7 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 7 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 8 then Form1.StaticText56.Caption := '+25'; if field[i, j] = 8 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 8 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 9 then Form1.StaticText56.Caption := 'T'; if field[i, j] = 9 then Form1.StaticText56.Color := $00ABCFBB; if field[i, j] = 9 then Form1.StaticText56.Font.Color := $80000008;
if field[i, j] = 10 then Form1.StaticText56.Caption := 'P'; if field[i, j] = 10 then Form1.StaticText56.Color := $00FFC0C0; if field[i, j] = 10 then Form1.StaticText56.Font.Color := $80000008;
if field[i, j] = 11 then Form1.StaticText56.Caption := 'B'; if field[i, j] = 11 then Form1.StaticText56.Color := $0080FFFF; if field[i, j] = 11 then Form1.StaticText56.Font.Color := $80000008;
if field[i, j] = 12 then Form1.StaticText56.Caption := 'Z'; if field[i, j] = 12 then Form1.StaticText56.Color := $00000000; if field[i, j] = 12 then Form1.StaticText56.Font.Color := $00FFFFFF;
if field[i, j] = 13 then Form1.StaticText56.Caption := 'Z'; if field[i, j] = 13 then Form1.StaticText56.Color := $00000000; if field[i, j] = 13 then Form1.StaticText56.Font.Color := $00FFFFFF;
if field[i, j] = 14 then Form1.StaticText56.Caption := 'End'; if field[i, j] = 14 then Form1.StaticText56.Color := $000F0FFF; if field[i, j] = 14 then Form1.StaticText56.Font.Color := $00FFFFFF;
if field[i, j] = 15 then Form1.StaticText56.Caption := '-10'; if field[i, j] = 15 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 15 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 16 then Form1.StaticText56.Caption := '-5'; if field[i, j] = 16 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 16 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 17 then Form1.StaticText56.Caption := '-1'; if field[i, j] = 17 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 17 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 18 then Form1.StaticText56.Caption := '+1'; if field[i, j] = 18 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 18 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 19 then Form1.StaticText56.Caption := '+5'; if field[i, j] = 19 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 19 then Form1.StaticText56.Font.Color := $00000000;
if field[i, j] = 20 then Form1.StaticText56.Caption := '-25'; if field[i, j] = 20 then Form1.StaticText56.Color := $00BBECF4; if field[i, j] = 20 then Form1.StaticText56.Font.Color := $00000000;
end; //============================================= function GameField_Fill : integer; begin
for j := 0 to 5 do for i := 0 to 7 do begin Color_Chars(); if k = 0 then Form1.StaticText7.Caption := Form1.StaticText56.Caption; if k = 0 then Form1.StaticText7.Color := Form1.StaticText56.Color; if k = 0 then Form1.StaticText7.Font.Color := Form1.StaticText56.Font.Color;
if k = 1 then Form1.StaticText8.Caption := Form1.StaticText56.Caption; if k = 1 then Form1.StaticText8.Color := Form1.StaticText56.Color; if k = 1 then Form1.StaticText8.Font.Color := Form1.StaticText56.Font.Color;
if k = 2 then Form1.StaticText9.Caption := Form1.StaticText56.Caption; if k = 2 then Form1.StaticText9.Color := Form1.StaticText56.Color; if k = 2 then Form1.StaticText9.Font.Color := Form1.StaticText56.Font.Color;
if k = 3 then Form1.StaticText10.Caption := Form1.StaticText56.Caption; if k = 3 then Form1.StaticText10.Color := Form1.StaticText56.Color; if k = 3 then Form1.StaticText10.Font.Color := Form1.StaticText56.Font.Color;
if k = 4 then Form1.StaticText11.Caption := Form1.StaticText56.Caption; if k = 4 then Form1.StaticText11.Color := Form1.StaticText56.Color; if k = 4 then Form1.StaticText11.Font.Color := Form1.StaticText56.Font.Color;
if k = 5 then Form1.StaticText12.Caption := Form1.StaticText56.Caption; if k = 5 then Form1.StaticText12.Color := Form1.StaticText56.Color; if k = 5 then Form1.StaticText12.Font.Color := Form1.StaticText56.Font.Color;
if k = 6 then Form1.StaticText13.Caption := Form1.StaticText56.Caption; if k = 6 then Form1.StaticText13.Color := Form1.StaticText56.Color; if k = 6 then Form1.StaticText13.Font.Color := Form1.StaticText56.Font.Color;
if k = 7 then Form1.StaticText14.Caption := Form1.StaticText56.Caption; if k = 7 then Form1.StaticText14.Color := Form1.StaticText56.Color; if k = 7 then Form1.StaticText14.Font.Color := Form1.StaticText56.Font.Color;
if k = 8 then Form1.StaticText15.Caption := Form1.StaticText56.Caption; if k = 8 then Form1.StaticText15.Color := Form1.StaticText56.Color; if k = 8 then Form1.StaticText15.Font.Color := Form1.StaticText56.Font.Color;
if k = 9 then Form1.StaticText16.Caption := Form1.StaticText56.Caption; if k = 9 then Form1.StaticText16.Color := Form1.StaticText56.Color; if k = 9 then Form1.StaticText16.Font.Color := Form1.StaticText56.Font.Color;
if k = 10 then Form1.StaticText17.Caption := Form1.StaticText56.Caption; if k = 10 then Form1.StaticText17.Color := Form1.StaticText56.Color; if k = 10 then Form1.StaticText17.Font.Color := Form1.StaticText56.Font.Color;
if k = 11 then Form1.StaticText18.Caption := Form1.StaticText56.Caption; if k = 11 then Form1.StaticText18.Color := Form1.StaticText56.Color; if k = 11 then Form1.StaticText18.Font.Color := Form1.StaticText56.Font.Color;
if k = 12 then Form1.StaticText19.Caption := Form1.StaticText56.Caption; if k = 12 then Form1.StaticText19.Color := Form1.StaticText56.Color; if k = 12 then Form1.StaticText19.Font.Color := Form1.StaticText56.Font.Color;
if k = 13 then Form1.StaticText20.Caption := Form1.StaticText56.Caption; if k = 13 then Form1.StaticText20.Color := Form1.StaticText56.Color; if k = 13 then Form1.StaticText20.Font.Color := Form1.StaticText56.Font.Color;
if k = 14 then Form1.StaticText21.Caption := Form1.StaticText56.Caption; if k = 14 then Form1.StaticText21.Color := Form1.StaticText56.Color; if k = 14 then Form1.StaticText21.Font.Color := Form1.StaticText56.Font.Color;
if k = 15 then Form1.StaticText22.Caption := Form1.StaticText56.Caption; if k = 15 then Form1.StaticText22.Color := Form1.StaticText56.Color; if k = 15 then Form1.StaticText22.Font.Color := Form1.StaticText56.Font.Color;
if k = 16 then Form1.StaticText23.Caption := Form1.StaticText56.Caption; if k = 16 then Form1.StaticText23.Color := Form1.StaticText56.Color; if k = 16 then Form1.StaticText23.Font.Color := Form1.StaticText56.Font.Color;
if k = 17 then Form1.StaticText24.Caption := Form1.StaticText56.Caption; if k = 17 then Form1.StaticText24.Color := Form1.StaticText56.Color; if k = 17 then Form1.StaticText24.Font.Color := Form1.StaticText56.Font.Color;
if k = 18 then Form1.StaticText25.Caption := Form1.StaticText56.Caption; if k = 18 then Form1.StaticText25.Color := Form1.StaticText56.Color; if k = 18 then Form1.StaticText25.Font.Color := Form1.StaticText56.Font.Color;
if k = 19 then Form1.StaticText26.Caption := Form1.StaticText56.Caption; if k = 19 then Form1.StaticText26.Color := Form1.StaticText56.Color; if k = 19 then Form1.StaticText26.Font.Color := Form1.StaticText56.Font.Color;
if k = 20 then Form1.StaticText27.Caption := Form1.StaticText56.Caption; if k = 20 then Form1.StaticText27.Color := Form1.StaticText56.Color; if k = 20 then Form1.StaticText27.Font.Color := Form1.StaticText56.Font.Color;
if k = 21 then Form1.StaticText28.Caption := Form1.StaticText56.Caption; if k = 21 then Form1.StaticText28.Color := Form1.StaticText56.Color; if k = 21 then Form1.StaticText28.Font.Color := Form1.StaticText56.Font.Color;
if k = 22 then Form1.StaticText29.Caption := Form1.StaticText56.Caption; if k = 22 then Form1.StaticText29.Color := Form1.StaticText56.Color; if k = 22 then Form1.StaticText29.Font.Color := Form1.StaticText56.Font.Color;
if k = 23 then Form1.StaticText30.Caption := Form1.StaticText56.Caption; if k = 23 then Form1.StaticText30.Color := Form1.StaticText56.Color; if k = 23 then Form1.StaticText30.Font.Color := Form1.StaticText56.Font.Color;
if k = 24 then Form1.StaticText31.Caption := Form1.StaticText56.Caption; if k = 24 then Form1.StaticText31.Color := Form1.StaticText56.Color; if k = 24 then Form1.StaticText31.Font.Color := Form1.StaticText56.Font.Color;
if k = 25 then Form1.StaticText32.Caption := Form1.StaticText56.Caption; if k = 25 then Form1.StaticText32.Color := Form1.StaticText56.Color; if k = 25 then Form1.StaticText32.Font.Color := Form1.StaticText56.Font.Color;
if k = 26 then Form1.StaticText33.Caption := Form1.StaticText56.Caption; if k = 26 then Form1.StaticText33.Color := Form1.StaticText56.Color; if k = 26 then Form1.StaticText33.Font.Color := Form1.StaticText56.Font.Color;
if k = 27 then Form1.StaticText34.Caption := Form1.StaticText56.Caption; if k = 27 then Form1.StaticText34.Color := Form1.StaticText56.Color; if k = 27 then Form1.StaticText34.Font.Color := Form1.StaticText56.Font.Color;
if k = 28 then Form1.StaticText35.Caption := Form1.StaticText56.Caption; if k = 28 then Form1.StaticText35.Color := Form1.StaticText56.Color; if k = 28 then Form1.StaticText35.Font.Color := Form1.StaticText56.Font.Color;
if k = 29 then Form1.StaticText36.Caption := Form1.StaticText56.Caption; if k = 29 then Form1.StaticText36.Color := Form1.StaticText56.Color; if k = 29 then Form1.StaticText36.Font.Color := Form1.StaticText56.Font.Color;
if k = 30 then Form1.StaticText37.Caption := Form1.StaticText56.Caption; if k = 30 then Form1.StaticText37.Color := Form1.StaticText56.Color; if k = 30 then Form1.StaticText37.Font.Color := Form1.StaticText56.Font.Color;
if k = 31 then Form1.StaticText38.Caption := Form1.StaticText56.Caption; if k = 31 then Form1.StaticText38.Color := Form1.StaticText56.Color; if k = 31 then Form1.StaticText38.Font.Color := Form1.StaticText56.Font.Color;
if k = 32 then Form1.StaticText39.Caption := Form1.StaticText56.Caption; if k = 32 then Form1.StaticText39.Color := Form1.StaticText56.Color; if k = 32 then Form1.StaticText39.Font.Color := Form1.StaticText56.Font.Color;
if k = 33 then Form1.StaticText40.Caption := Form1.StaticText56.Caption; if k = 33 then Form1.StaticText40.Color := Form1.StaticText56.Color; if k = 33 then Form1.StaticText40.Font.Color := Form1.StaticText56.Font.Color;
if k = 34 then Form1.StaticText41.Caption := Form1.StaticText56.Caption; if k = 34 then Form1.StaticText41.Color := Form1.StaticText56.Color; if k = 34 then Form1.StaticText41.Font.Color := Form1.StaticText56.Font.Color;
if k = 35 then Form1.StaticText42.Caption := Form1.StaticText56.Caption; if k = 35 then Form1.StaticText42.Color := Form1.StaticText56.Color; if k = 35 then Form1.StaticText42.Font.Color := Form1.StaticText56.Font.Color;
if k = 36 then Form1.StaticText43.Caption := Form1.StaticText56.Caption; if k = 36 then Form1.StaticText43.Color := Form1.StaticText56.Color; if k = 36 then Form1.StaticText43.Font.Color := Form1.StaticText56.Font.Color;
if k = 37 then Form1.StaticText44.Caption := Form1.StaticText56.Caption; if k = 37 then Form1.StaticText44.Color := Form1.StaticText56.Color; if k = 37 then Form1.StaticText44.Font.Color := Form1.StaticText56.Font.Color;
if k = 38 then Form1.StaticText45.Caption := Form1.StaticText56.Caption; if k = 38 then Form1.StaticText45.Color := Form1.StaticText56.Color; if k = 38 then Form1.StaticText45.Font.Color := Form1.StaticText56.Font.Color;
if k = 39 then Form1.StaticText46.Caption := Form1.StaticText56.Caption; if k = 39 then Form1.StaticText46.Color := Form1.StaticText56.Color; if k = 39 then Form1.StaticText46.Font.Color := Form1.StaticText56.Font.Color;
k := k + 1; end;
end; //============================================= function Up_Str_App : integer; begin Randomize; for i := 0 to 7 do field[i, 5] :=Random(20);
end; //============================================= function Level_Count : integer; begin lvl := StrToInt(Form1.StaticText6.Caption); lvl := lvl + 1; Form1.StaticText6.Caption := IntToStr(lvl);
lvl := StrToInt(Form1.StaticText5.Caption); lvl := lvl + 1; Form1.StaticText5.Caption := IntToStr(lvl);
lvl := StrToInt(Form1.StaticText4.Caption); lvl := lvl + 1; Form1.StaticText4.Caption := IntToStr(lvl);
lvl := StrToInt(Form1.StaticText3.Caption); lvl := lvl + 1; Form1.StaticText3.Caption := IntToStr(lvl);
lvl := StrToInt(Form1.StaticText2.Caption); lvl := lvl + 1; Form1.StaticText2.Caption := IntToStr(lvl);
end; //============================================= function Set_Marker_Count : integer; begin if n = 0 then begin If markersave = 0 Then et := field[0, 0]; If markersave = 1 Then et := field[1, 0]; If markersave = 2 Then et := field[2, 0]; If markersave = 3 Then et := field[3, 0]; If markersave = 4 Then et := field[4, 0]; If markersave = 5 Then et := field[5, 0]; If markersave = 6 Then et := field[6, 0]; If markersave = 7 Then et := field[7, 0]; //Form1.Caption := IntToStr(markersave); end;
if n = 0 then begin tk := StrToInt(Form1.StaticText48.Caption); if et = 0 then tk := tk +1; if et = 0 then Form1.StaticText48.Caption := IntToStr(tk); if et = 1 then tk := tk -1; if et = 1 then Form1.StaticText48.Caption := IntToStr(tk); if et = 2 then tk := tk +5; if et = 2 then Form1.StaticText48.Caption := IntToStr(tk); if et = 3 then tk := tk -5; if et = 3 then Form1.StaticText48.Caption := IntToStr(tk); if et = 4 then tk := tk +10; if et = 4 then Form1.StaticText48.Caption := IntToStr(tk); if et = 5 then tk := tk -10; if et = 5 then Form1.StaticText48.Caption := IntToStr(tk); if et = 6 then tk := tk +15; if et = 6 then Form1.StaticText48.Caption := IntToStr(tk); if et = 7 then tk := tk -15; if et = 7 then Form1.StaticText48.Caption := IntToStr(tk); if et = 8 then tk := tk +25; if et = 8 then Form1.StaticText48.Caption := IntToStr(tk); if et = 9 then tk := tk +500; if et = 9 then Form1.StaticText48.Caption := IntToStr(tk); if et = 10 then tk := tk +100; if et = 10 then Form1.StaticText48.Caption := IntToStr(tk); if et = 11 then tk := tk -200; if et = 11 then Form1.StaticText48.Caption := IntToStr(tk);
if et = 12 then Form1.StaticText48.Caption := '0'; if et = 13 then Form1.StaticText48.Caption := '0'; if et = 14 then Form1.StaticText48.Caption := 'End'; if et = 14 then Application.Terminate;
if et = 15 then tk := tk -10; if et = 15 then Form1.StaticText48.Caption := IntToStr(tk); if et = 16 then tk := tk -5; if et = 16 then Form1.StaticText48.Caption := IntToStr(tk); if et = 17 then tk := tk -1; if et = 17 then Form1.StaticText48.Caption := IntToStr(tk); if et = 18 then tk := tk +1; if et = 18 then Form1.StaticText48.Caption := IntToStr(tk); if et = 19 then tk := tk +5; if et = 19 then Form1.StaticText48.Caption := IntToStr(tk); if et = 20 then tk := tk -25; if et = 20 then Form1.StaticText48.Caption := IntToStr(tk); n := 1; end; Form1.Timer1.Enabled := True; end; //============================================= function Save_Color : integer; begin savecolor[0] :=Form1.StaticText7.Color; savecolor[1] :=Form1.StaticText8.Color; savecolor[2] :=Form1.StaticText9.Color; savecolor[3] :=Form1.StaticText10.Color; savecolor[4] :=Form1.StaticText11.Color; savecolor[5] :=Form1.StaticText12.Color; savecolor[6] :=Form1.StaticText13.Color; savecolor[7] :=Form1.StaticText14.Color;
end; //============================================= function Num_Move : integer; begin Up_Str_App(); k := 0; for j := 0 to 5 do for i := 0 to 7 do begin field[i, j] := field[i, j + 1]; end; GameField_Fill(); Marker_Reset(); end; //============================================= function Dn_Count : integer; begin n := 0; Set_Marker_Count(); Level_Count(); end; //============================================= function Print_Ind : integer; begin if IndLent = 1 then Form1.StaticText55.Visible := False; if IndLent = 2 then Form1.StaticText54.Visible := False; if IndLent = 3 then Form1.StaticText53.Visible := False; if IndLent = 4 then Form1.StaticText52.Visible := False; if IndLent = 5 then Form1.StaticText51.Visible := False; if IndLent = 6 then Form1.StaticText50.Visible := False; if IndLent = 7 then Form1.StaticText49.Visible := False; if IndLent = 7 then Form1.Timer1.Interval := 100;
if IndLent = 7 then begin Form1.StaticText55.Visible := True; Form1.StaticText54.Visible := True; Form1.StaticText53.Visible := True; Form1.StaticText52.Visible := True; Form1.StaticText51.Visible := True; Form1.StaticText50.Visible := True; Form1.StaticText49.Visible := True; end; end; //=============================================
procedure TForm1.FormShow(Sender: TObject); begin
StaticText49.Height :=8; StaticText50.Height :=8; StaticText51.Height :=8; StaticText52.Height :=8; StaticText53.Height :=8; StaticText54.Height :=8; StaticText55.Height :=8;
StaticText49.Width :=32; StaticText50.Width :=32; StaticText51.Width :=32; StaticText52.Width :=32; StaticText53.Width :=32; StaticText54.Width :=32; StaticText55.Width :=32;
firstset := 0; markersave := 100; k := 0; n := 0; IndLent := 0; FieldFill(); //Color_Chars(); GameField_Fill();
//StaticText7.Caption :=IntToStr(field[1,1]); //StaticText8.Caption :=IntToStr(field[1,2]); //StaticText9.Caption :=IntToStr(field[1,3]); //StaticText10.Caption :=IntToStr(field[1,4]); //StaticText11.Caption :=IntToStr(field[1,5]); //StaticText12.Caption :=IntToStr(field[1,6]);
end; //=============================================
procedure TForm1.StaticText6Click(Sender: TObject); begin Num_Move(); Dn_Count(); end;
procedure TForm1.StaticText7Click(Sender: TObject); begin
if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText7.Color := $00FD1117; if firstset = 0 then markersave := 0; if firstset = 0 then firstset := 1; Set_Marker_Count(); end;
procedure TForm1.StaticText8Click(Sender: TObject); begin
if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText8.Color := $00FD1117; if firstset = 0 then markersave := 1; if firstset = 0 then firstset := 1; Set_Marker_Count(); end;
procedure TForm1.StaticText9Click(Sender: TObject); begin
if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText9.Color := $00FD1117; if firstset = 0 then markersave := 2; if firstset = 0 then firstset := 1; Set_Marker_Count(); end;
procedure TForm1.StaticText10Click(Sender: TObject); begin
if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText10.Color := $00FD1117; if firstset = 0 then markersave := 3; if firstset = 0 then firstset := 1; Set_Marker_Count(); end;
procedure TForm1.StaticText11Click(Sender: TObject); begin
if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText11.Color := $00FD1117; if firstset = 0 then markersave := 4; if firstset = 0 then firstset := 1; Set_Marker_Count(); end;
procedure TForm1.StaticText12Click(Sender: TObject); begin
if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText12.Color := $00FD1117; if firstset = 0 then markersave := 5; if firstset = 0 then firstset := 1; Set_Marker_Count(); end;
procedure TForm1.StaticText13Click(Sender: TObject); begin
if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText13.Color := $00FD1117; if firstset = 0 then markersave := 6; if firstset = 0 then firstset := 1; Set_Marker_Count(); end;
procedure TForm1.StaticText14Click(Sender: TObject); begin
if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText14.Color := $00FD1117; if firstset = 0 then markersave := 7; if firstset = 0 then firstset := 1; Set_Marker_Count(); end;
procedure TForm1.StaticText48Click(Sender: TObject); begin //Form1.Caption := IntToStr(markersave);
end;
procedure TForm1.Timer1Timer(Sender: TObject); begin IndLent := IndLent + 1;
if IndLent = 9 then Num_Move(); if IndLent = 9 then Dn_Count();
if IndLent = 9 then Timer1.Interval := 500; if IndLent = 9 then IndLent := 0; Print_Ind();
end; //============================================= function Move_Point_Left : integer; begin if markersave = 0 then begin markersave := 7; firstset := 0; Form1.StaticText7.Color := savecolor[0]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText14.Color := $00FD1117; if firstset = 0 then markersave := 7; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 1 then begin markersave := 0; firstset := 0; Form1.StaticText8.Color := savecolor[1]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText7.Color := $00FD1117; if firstset = 0 then markersave := 0; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 2 then begin markersave := 1; firstset := 0; Form1.StaticText9.Color := savecolor[2]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText8.Color := $00FD1117; if firstset = 0 then markersave := 1; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 3 then begin markersave := 2; firstset := 0; Form1.StaticText10.Color := savecolor[3]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText9.Color := $00FD1117; if firstset = 0 then markersave := 2; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 4 then begin markersave := 3; firstset := 0; Form1.StaticText11.Color := savecolor[4]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText10.Color := $00FD1117; if firstset = 0 then markersave := 3; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 5 then begin markersave := 4; firstset := 0; Form1.StaticText12.Color := savecolor[5]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText11.Color := $00FD1117; if firstset = 0 then markersave := 4; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 6 then begin markersave := 5; firstset := 0; Form1.StaticText13.Color := savecolor[6]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText12.Color := $00FD1117; if firstset = 0 then markersave := 5; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 7 then begin markersave := 6; firstset := 0; Form1.StaticText14.Color := savecolor[7]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText13.Color := $00FD1117; if firstset = 0 then markersave := 6; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
markersave := vt; n := 0; Set_Marker_Count();
end; //============================================= function Move_Point_Right : integer; begin if markersave = 0 then begin markersave := 1; firstset := 0; Form1.StaticText7.Color := savecolor[0]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText8.Color := $00FD1117; if firstset = 0 then markersave := 1; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 1 then begin markersave := 2; firstset := 0; Form1.StaticText8.Color := savecolor[1]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText9.Color := $00FD1117; if firstset = 0 then markersave := 2; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 2 then begin markersave := 3; firstset := 0; Form1.StaticText9.Color := savecolor[2]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText10.Color := $00FD1117; if firstset = 0 then markersave := 3; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 3 then begin markersave := 4; firstset := 0; Form1.StaticText10.Color := savecolor[3]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText11.Color := $00FD1117; if firstset = 0 then markersave := 4; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 4 then begin markersave := 5; firstset := 0; Form1.StaticText11.Color := savecolor[4]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText12.Color := $00FD1117; if firstset = 0 then markersave := 5; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 5 then begin markersave := 6; firstset := 0; Form1.StaticText12.Color := savecolor[5]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText13.Color := $00FD1117; if firstset = 0 then markersave := 6; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 6 then begin markersave := 7; firstset := 0; Form1.StaticText13.Color := savecolor[6]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText14.Color := $00FD1117; if firstset = 0 then markersave := 7; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
if markersave = 7 then begin markersave := 0; firstset := 0; Form1.StaticText14.Color := savecolor[7]; if firstset = 0 then Save_Color(); if firstset = 0 then Form1.StaticText7.Color := $00FD1117; if firstset = 0 then markersave := 0; if firstset = 0 then firstset := 1; Set_Marker_Count(); vt := markersave; markersave := 10; end;
markersave := vt; n := 0; Set_Marker_Count(); end; //============================================= procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin //Form1.Caption := IntToStr(Key); if Key = 37 then Move_Point_Left(); if Key = 39 then Move_Point_Right();
end;
procedure TForm1.Image1Click(Sender: TObject); begin end; end.
|