หน้าแรก
 การบ้าน
  C/C++ new
  Java new
  Windows Phone
  แจ้งเรื่องที่ต้องการ
 บทความ
  .NET
  Android
  Blackberry
  C++Builder
  Delphi
  Java
  Mobile
  Open Source
  Pocket PC
  Visual Basic
  Web
  Windows Phone
  Others
 แบบเรียนฟรี
  ASP
  ASP.NET Webmatrix
  C++
  eVB
  J2ME
  Java
  PHP
 ซอร์สโค้ด
  Android
  ASP
  C++
  VC++
  CGI-Perl
  Delphi
  Java
  jQuery
  PHP
  Visual Basic
  .NET
 บริการจากเรา
  เปิดท้าย... ขายโค้ด
  Freeware
  อัตราค่าโฆษณา
  รายชื่อลูกค้า
  สถิติผู้เข้าเว็บ
 ดาว์นโหลด
 ค้นหาข้อมูล
 กระดานสนทนา
  .NET
  C/C++
  Delphi
  Java
  Palm/PocketPC
  Visual Basic
  Web
  อื่นๆ
 กระดานงาน
 ลิงค์เว็บ
 เกี่ยวกับผม
 อัตราค่าโฆษณา
Social Network

Facebook  Twitter  YouTube
 New Article
 Webboard
 Freelanceboard
Freeware
โปรแกรมเบอร์ดี (BerDee)
โปรแกรมเบอร์ดี (Android)
เกมส์เป่ายิ้งฉุบ
เกมส์เป่ายิ้งฉุบ(Android)
WebcamMonitor
WebcamMonitor(Windows)
scSendMail
scSendMail(Windows)
MSN Caption
MSN Caption(Windows)
  Freelance comment
  ติดต่อสอบถามมาได้ตลอดนะ...
2015-07-29 13:35:58
  ถ้าผมต้องการเว็บที่พัฒน...
2015-01-18 15:33:54
  ถ้าผมต้องการเว็บที่พัฒน...
2015-01-18 15:32:51
  ติดต่อสอบถามเข้ามาได้นะ...
2014-01-06 12:47:38
  ถ้ายังหาคนสอนไม่ได้ ก็ลอ...
2013-07-06 01:04:37
  สนใจส่งขอบเขตมาคุยราคาก...
2013-03-24 18:54:20
  ถ้ายังไม่มีคนรับงานติดต...
2012-12-16 19:18:14
  สนใจคะ ติดต่อ 0905076277...
2012-11-12 11:07:46
  รับทำโปรเจ็คนักศึกษาหรื...
2012-10-29 03:10:46
  sukit_te34@hotmail.com...
2012-10-29 03:09:36
  Webboard comment
  เขียนโปรแกรมภาษาจาวา
1.โ...

2023-09-12 11:40:28
  ต้องลอง debug ดูเองครับ
ไล่...

2023-06-08 18:03:06
  ร้านค้าแห่งหนึ่ง จะต้องน...
2021-09-21 08:47:08
  จงเขียนโปรแกรมดำเนินการ...
2021-05-07 15:06:11
  จงเขียนโปรแกรมสำหรับคำน...
2021-03-09 14:21:45
  ขอดู...
2021-01-04 23:56:45
  ขอโค้ดเพื่อทำการเรียนกา...
2020-12-09 23:02:09
  แล้ว ?...
2020-12-09 10:56:34
  จ้า...
2020-10-18 16:53:21
  พอดีผมเหลื่อแค่ตัดสต๊อก...
2020-05-31 21:49:43
  Homework comment
  เขียนโปรแกรมเพื่อรับค่า...
2022-02-24 10:45:17
  จากโค้ดนี้อะครับ พอดีลอง...
2021-03-22 01:22:39
  จากโค้ดนี้อะครับ พอดีลอง...
2021-03-22 01:22:39
  โจทย์การบ้าน c++ เขียนรูปแ...
2020-04-06 11:01:33
  แบบนี้ขอเป็น ภาษา php หน่อย...
2019-09-18 14:36:34
  ผมไม่อยากให้คุณได้คะแนน...
2019-04-27 01:29:07
  อาจารย์เขาบอกแนวข้อสอบม...
2019-04-27 00:44:29
  ขอสอบถามการเขียน c++ ครับ เ...
2018-04-02 12:19:21
  โค้ดตัวอย่างศึกษาให้เข้...
2017-11-26 14:50:05
  คำนวณค่าน้ำโดยรับค่ามิเ...
2017-11-20 23:15:26
  Article comment
  เท่าที่อ่าน error คือพื้นที่...
2022-03-23 13:56:48
  เรียน สอบถามปัญหา กับ อ.คร...
2022-01-24 17:39:49
  ต้องการ ให้เขียน โปรแกรม ...
2019-12-09 11:39:58
  รับเขียน arx จาก vc++ 2017 ล็อคโปร...
2019-09-19 09:48:09
  ทำการ register ไฟล์ที่ชื่อ mswinsck.oc...
2019-09-17 14:05:56
  ใน vb 6 ไม่มี component winsock เลยค่ะ ส...
2019-09-03 10:31:02
  รบกวนขอสอบถามหน่อยนะครั...
2019-03-04 05:31:04
  สามารถนำตัวหนังสือจากภา...
2018-12-25 08:54:32
  มีcode ของ VB ไหมค่ะ ถ้ามีรบกว...
2017-09-28 16:50:02
  น่าจะได้ครับ ไม่เคยลอง
...

2017-07-11 09:59:35
  9Mcode comment

Link Exchange

อัตราค่าโฆษณา
 
 Webboard

- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -

กระทู้ #605 [Delphi] (จาก IP: 203.113.67.36)

อยากให้ช่วยอธิบายโคดเหมือนคนล่างอะคับ

เอาเป็นภาษาไทยนะคับ คอมเม้นเป็นภาษาไทยนะคับผม
นี่เป็นเว็บตัวนี้นะคับถ้าไม่เข้าใจอะ 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.
จากคุณ : jinkasama / jinkasama01@thaimail.com [2006-09-29 19:45:34]  
ตอบกระทู้
  • ห้ามการโฆษณา หากต้องการติดต่อหาลูกค้า ติดต่อโฆษณาโดยตรงได้ที่ webmaster@sourcecode.in.th
  • ห้ามใช้คำหยาบและคำพูดที่ไม่เหมาะสม
  • ขอสงวนสิทธิหากตรวจพบ ข้อความที่ไม่เหมาะสม ข้อความนั้นจะถูกลบทันที
ชื่อ
อีเมล์
รายละเอียด

- - - - - - - - - - - - - - ผู้ให้การสนับสนุน- - - - - - - - - - - - - -

 
 
คลิปสอนเขียนโปรแกรม
เรียนเขียนโปรแกรมดอทเน็ต
เรียนเขียนโปรแกรมแอนดรอยด์
เรียนเขียนโปรแกรมเบล็คเบอร์รี่
เรียนเขียนโปรแกรมซี ซีพลัสพลัส
เรียนเขียนโปรแกรมจาวา
เรียนการใช้งานลินุกส์
เรียนการเขียนโปรแกรมวินโดว์โฟน
เรียนการเขียนโปรแกรมพีเฮชพี มายเอสคิวเอล
อัตราค่าโฆษณา
 
Tutorial
eVB Tutorial
ASP.NET Webmatrix Tutorial
J2ME Tutorial
C++  Tutorial
Java  Tutorial
PHP Tutorial
ASP Tutorial
 
แบบสำรวจ

Home - Article - Tutorial - Sourcecode - Dev Handbook - Search - WebBoard - Links - About Us

สงวนลิขสิทธิ์ ห้ามคัดลอก ทำซ้ำ แก้ไข ดัดแปลง ไม่ว่าในรูปแบบใด โดยไม่ได้รับอนุญาตเป็นลายลักษณ์อักษร
เลขทะเบียนพาณิชย์อิเล็กทรอนิกส์จากกระทรวงพาณิชย์: 7100503002000
Copyright 2001 SourceCode.in.th