Forms,, Menus, StdCtrls, Buttons, Spin, ExtCtrls, ImgList; = class (TForm): TMainMenu;: TMenuItem; : TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TMenuItem;: TLabel;: TPanel;: TLabel;: TSpinEdit;: TBitBtn;: TImageList;: TLabel;: TSpinEdit;: TBitBtn; GameNewClick (Sender: TObject ); BitBtn1Click (Sender: TObject); FormCreate (Sender: TObject); FormPaint (Sender: TObject); HelpAboutClick (Sender: TObject); HelpRuleClick (Sender: TObject); GameExitClick (Sender: TObject);
{Private declarations}
{Public declarations};: TForm1;: integer;: integer = -1;: integer = -1; rusdlg, about, rules;
{$ R *. dfm} TForm1.GameNewClick (Sender: TObject);: = 100;. Caption: = format ('Ваша сума:% d', [Score]);. visible: = true;. MaxValue: = 100;. Show;; TForm1.BitBtn1Click (Sender: TObject); i: integer; not (SpinNumb.Value in [2 .. 12]) then
begin ('Число має бути від 2 до 12');
exit;; Spin.Value <1 then
begin ('Ставка повинна бути більше 0');
exit;; Spin.Value> Score then
begin ('Ставка повинна бути менше поточного рахунку');
exit;; i: = 1 to 10 do: = random (6);: = random (6); (nil); (100);;: = t1 + t2 +2; ( (i <7) and (SpinNumb.Value <7)) ((i> 7) and (SpinNumb.Value> 7)) then ('Ви виграли!!' # 13'Ставка% d '# 13'Виігриш% d ', [Spin.value, Spin.value]); (Score, Spin.value); elsei = SpinNumb.Value then (' Ви виграли!! '# 13'Ставка% d' # 13'Виігриш% d ', [ Spin.value, Spin.value * 4]); (Score, Spin.value * 4);. Caption: = IntToStr (Score); else ('Ви Проігалі!!' # 13'Ставка% d ', [Spin. value]); (Score, Spin.value);;. Caption: = format ('Ваша сума:% d', [Score]);
if score = 0 then ('Ви проігалі!!' # 13'Остаток на рахунку - 0. ');
t1: = -1;. Hide;. Hide;;;. MaxValue: = Score; spin.Value> score then Spin.Value: = score;; TForm1.FormCreate (Sender: TObject) ;;; TForm1.FormPaint (Sender: TObject); not Panel.Visible then exit; t1 = -1 then exit;. Draw (canvas, 75,50, t1);. Draw (canvas, 155,50, t2); ;
TForm1.HelpAboutClick (Sender: TObject);. Show;; TForm1.HelpRuleClick (Sender: TObject);. Show;; TForm1.GameExitClick (Sender: TObject);;;.
Модуль: rules.pas Всього рядків: 35 rules;, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,, StdCtrls, Buttons, ComCtrls; = class (TForm): TRichEdit;: TBitBtn; FormCreate (Sender: TObject);
{Private declarations}
{Public declarations};: TFrmRules;
{$ R *. dfm} TFrmRules.FormCreate (Sender: TObject);. SelStart: = 0;. SelLength: = 14;. SelAttributes.Size: = 16;. SelAttributes.Style: = [fs...