var
Form1: TForm1;
MousePos: TPoint;
bet_x : Integer;
bet_y : Integer;
i, j, k, l, r, m, n : integer;// i:大迴圈 J:跑燈迴圈 K:倍數燈 L:倍數燈 M:大小燈 n:比倍迴圈
left_bai, right_bai : Integer; //左邊倍數..右邊倍數
Ti, Tj : Cardinal; //迴圈時間 , 押注連續時間
rb, rd : integer;//加速用定位
score : Integer;//現有分數
take_score : Integer;//得分
bet_ok : Boolean; //押注完成
re_bet : Boolean; //重新押注
bar_bet, seven_bet, star_bet, Watermelon_bet, bell_bet, Lemon_bet, Orange_bet, apple_bet : Integer;
bar_bet_full, seven_bet_full, star_bet_full, Watermelon_bet_full, bell_bet_full, Lemon_bet_full, Orange_bet_full, apple_bet_full : Boolean; //下注全滿
bet_all : Integer;//押注總和
runing : Boolean; //正在跑燈
not_take_score : Boolean;//是否已經取回得分
big_small : Integer; //大小 大:0 小:1
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
if (not AsphyreDevice1.Initialize()) then
begin
Close();
Exit;
end;
Randomize;
Ti := 451; //毫秒
score := 5000;
bet_ok := False;
runing := False;
re_bet := True;
not_take_score := False;
Tj := 50;
PlaySound('R_21',hinstance,SND_ASYNC or SND_RESOURCE);
end;
procedure TForm1.AsphyreDevice1Initialize(Sender: TObject;
var Success: Boolean);
begin
Success:=AsphyreFonts1.LoadFromASDb(ASDb1);
if (Success) then
Success:=AsphyreImages1.LoadFromASDb(ASDB1);
//if (Success) then SoundSystem1.LoadFromASDb(ASDb1);
AsphyreTimer1.Enabled:= Success;
end;
procedure TForm1.AsphyreDevice1Render(Sender: TObject);
begin
AsphyreCanvas1.Draw(AsphyreImages1.Image['23ok1.image'],0,0,0,1); //背景加載
AsphyreFonts1[2].TextOut(format('%6s',[IntToStr(score)]), 232,56, $FF2425FF); //資金顯示( $FF0400FF 正紅 )
AsphyreFonts1[2].TextOut(format('%6s',[IntToStr(take_score)]), 66,56, $FF2425FF); //得分顯示( $FF0400FF 正紅 )
AsphyreFonts1[2].TextOut(format('%2s',[IntToStr(bar_bet)]), 18,523, $FF2425FF); //BAR押注顯示( $FF0400FF 正紅 )
AsphyreFonts1[2].TextOut(format('%2s',[IntToStr(seven_bet)]), 64,523, $FF2425FF); //77押注顯示( $FF0400FF 正紅 )
AsphyreFonts1[2].TextOut(format('%2s',[IntToStr(star_bet)]), 112,523, $FF2425FF); //双星押注顯示( $FF0400FF 正紅 )
AsphyreFonts1[2].TextOut(format('%2s',[IntToStr(Watermelon_bet)]), 159,523, $FF2425FF); //西瓜押注顯示( $FF0400FF 正紅 )
AsphyreFonts1[2].TextOut(format('%2s',[IntToStr(bell_bet)]), 206,523, $FF2425FF); //鈴鐺押注顯示( $FF0400FF 正紅 )
AsphyreFonts1[2].TextOut(format('%2s',[IntToStr(Lemon_bet)]), 253,523, $FF2425FF); //檸檬押注顯示( $FF0400FF 正紅 )
AsphyreFonts1[2].TextOut(format('%2s',[IntToStr(Orange_bet)]), 300,523, $FF2425FF); //橘子押注顯示( $FF0400FF 正紅 )
AsphyreFonts1[2].TextOut(format('%2s',[IntToStr(apple_bet)]), 347,523, $FF2425FF); //蘋果押注顯示( $FF0400FF 正紅 )
//AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 174,90+i,0,1);
Demo;
Form1.FormStyle := fsStayOnTop;
if (bet_x > 267) and (bet_x < 374) and (bet_y > 555) and (bet_y < 588) then AsphyreCanvas1.Draw(AsphyreImages1.Image['start4.image'], 265,555,0,1);
if (bet_x > 24) and (bet_x < 83) and (bet_y > 559) and (bet_y < 587) then AsphyreCanvas1.Draw(AsphyreImages1.Image['big2.image'], 24,559,0,1);
if (bet_x > 89) and (bet_x < 144) and (bet_y > 559) and (bet_y < 587) then AsphyreCanvas1.Draw(AsphyreImages1.Image['small2.image'], 89,559,0,1);
end;
procedure TForm1.AsphyreTimer1Timer(Sender: TObject);
begin
AsphyreDevice1.Render(0,true);
AsphyreDevice1.Flip;
end;
procedure TForm1.Demo(); //選擇性顯示
begin
case j of
1 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 174,90,0,fxMax);
2 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 224,90,0,fxMax);
3 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 276,90,0,fxMax);
4 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 326,90,0,fxMax);
5 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 326,142,0,fxMax);
6 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 326,192,0,fxMax);
7 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 326,244,0,fxMax);
8 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 326,294,0,fxMax);
9 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 326,346,0,fxMax);
10 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 326,398,0,fxMax);
11 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 276,398,0,fxMax);
12 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 224,398,0,fxMax);
13 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 174,398,0,fxMax);
14 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 122,398,0,fxMax);
15 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 71,398,0,fxMax);
16 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 20,398,0,fxMax);
17 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 20,346,0,fxMax);
18 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 20,294,0,fxMax);
19 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 20,244,0,fxMax);
20 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 20,192,0,fxMax);
21 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 20,142,0,fxMax);
22 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 20,90,0,fxMax);
23 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 71,90,0,fxMax);
24 : AsphyreCanvas1.Draw(AsphyreImages1.Image['1.image'], 122,90,0,fxMax);
end;
case k of
1 : AsphyreCanvas1.Draw(AsphyreImages1.Image['-2.image'], 74,454,0,fxMax);
2 : AsphyreCanvas1.Draw(AsphyreImages1.Image['-2.image'], 121,454,0,fxMax);
3 : AsphyreCanvas1.Draw(AsphyreImages1.Image['-2.image'], 167,454,0,fxMax);
end;
case l of
1 : AsphyreCanvas1.Draw(AsphyreImages1.Image['-2.image'], 309,454,0,fxMax);
2 : AsphyreCanvas1.Draw(AsphyreImages1.Image['-2.image'], 261,454,0,fxMax);
3 : AsphyreCanvas1.Draw(AsphyreImages1.Image['-2.image'], 215,454,0,fxMax);
end;
case m of
1 : AsphyreCanvas1.Draw(AsphyreImages1.Image['-1.image'], 123,285,0,fxMax);
2 : AsphyreCanvas1.Draw(AsphyreImages1.Image['-1.image'], 244,285,0,fxMax);
end;
end;
procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if (x > 267) and (x < 374) and (y > 555) and (y < 588) or //这里是改变鼠标样子的 --開始
(x > 14) and (x < 55) and (y > 492) and (y < 546) or //--BAR
(x > 61) and (x < 101) and (y > 492) and (y < 546) or //--77
(x > 109) and (x < 149) and (y > 492) and (y < 546) or // --双星
(x > 155) and (x < 197) and (y > 492) and (y < 546) or // --西瓜
(x > 203) and (x < 243) and (y > 492) and (y < 546) or // --鈴鐺
(x > 249) and (x < 289) and (y > 492) and (y < 546) or // --檸檬
(x > 297) and (x < 337) and (y > 492) and (y < 546) or // --橘子
(x > 344) and (x < 384) and (y > 492) and (y < 546) or // --蘋果
(x > 24) and (x < 83) and (y > 559) and (y < 587) or // --押大
(x > 89) and (x < 144) and (y > 559) and (y < 587) then // --壓小
begin
form1.Cursor := crHandPoint //进入这个区域,鼠标变成手型
end
else
form1.Cursor := crDefault; //离开时,恢复默认鼠标
GetCursorPos(MousePos);
//Form1.Caption:='相對座標'+IntToStr(x)+','+IntToStr(y) + '絕對座標'+IntToStr(MousePos.X)+','+IntToStr(MousePos.Y);
bet_x := x;
bet_y := y;
end;
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (x > 267) and (x < 374) and (y > 555) and (y < 588) then // --開始
begin
end;
if (x > 14) and (x < 55) and (y > 492) and (y < 546) then //--BAR 押分
begin
end;
if (x > 109) and (x < 149) and (y > 492) and (y < 546) then //--77 押分
begin
end;
if (x > 109) and (x < 149) and (y > 492) and (y < 546) then // --双星
begin
end;
if (x > 155) and (x < 197) and (y > 492) and (y < 546) then // --西瓜
begin
end;
if (x > 203) and (x < 243) and (y > 492) and (y < 546) then // --鈴鐺
begin
end;
if (x > 249) and (x < 289) and (y > 492) and (y < 546) then // --檸檬
begin
end;
if (x > 297) and (x < 337) and (y > 492) and (y < 546) then // --橘子
begin
end;
if (x > 344) and (x < 384) and (y > 492) and (y < 546) then // --蘋果
begin
end;
end;
procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if (x > 267) and (x < 374) and (y > 555) and (y < 588) then // --開始壓下檢查
begin
if (not runing) then
begin
if (take_score > 0) then
begin
PlaySound('R_1',hinstance,SND_ASYNC or SND_RESOURCE);
score := take_score + score;
take_score := 0;
end
else
start_key();
end;
end;
if (x > 14) and (x < 55) and (y > 492) and (y < 546) then //--BAR 押分
begin
end;
if (x > 61) and (x < 101) and (y > 492) and (y < 546) then //--77 押分
begin
end;
if (x > 109) and (x < 149) and (y > 492) and (y < 546) then // --双星
begin
end;
if (x > 155) and (x < 197) and (y > 492) and (y < 546) then // --西瓜
begin
end;
if (x > 203) and (x < 243) and (y > 492) and (y < 546) then // --鈴鐺
begin
end;
if (x > 249) and (x < 289) and (y > 492) and (y < 546) then // --檸檬
begin
end;
if (x > 297) and (x < 337) and (y > 492) and (y < 546) then // --橘子
begin
end;
if (x > 344) and (x < 384) and (y > 492) and (y < 546) then // --蘋果
begin
end;
if (x > 24) and (x < 83) and (y > 559) and (y < 587) then // --押大
begin
if (take_score >= 1) then
begin
big_small := 0;
r := random(4);
Timer2.Enabled := True;
end;
end;
if (x > 89) and (x < 144) and (y > 559) and (y < 587) then // --押小
begin
if (take_score >= 1) then
begin
big_small := 1;
r := random(4);
Timer2.Enabled := True;
end;
end;
if (x > 201) and (x < 221) and (y > 54) and (y < 74) then //移動分數
begin
end;
end;
procedure TForm1.Timer1Timer(Sender: TObject); //跑燈
var
ra : integer;//總步數
begin
runing := True;
Timer1.Interval := Ti;
ra := 72;
ra := ra + r;
rb := rb + 1;
i := i + 1;
if (rb < 10) then
begin
Ti := Ti - 50; //加速
PlaySound('R_1',hinstance,SND_ASYNC or SND_RESOURCE);
end;
if (i > ra-12) then
begin
Ti := Ti + 50;//減速
PlaySound('R_1',hinstance,SND_ASYNC or SND_RESOURCE);
end;
j := j + 1;
if (j >= 25) then j := 1;
k := k + 1;
if (k >= 4) then k := 1;
l := l + 1;
if (l >= 4) then l := 1;
{m := m + 1;
if (m >= 3) then m := 1;}
//PlaySound('R_1',hinstance,SND_ASYNC or SND_RESOURCE);
//SoundSystem1.Play('Unti1.wav', False);
Form1.Caption := inttostr(Ti) + '-j:' + inttostr(j) + '-r:' + IntToStr(r) + '-ra:' + IntToStr(ra) + '--rb:' + IntToStr(rb) + '__';
if (i >= ra) then //燈跑完後要做的事
begin
Timer1.Enabled := False;
Ti := 451;
rb := 0;
i := j+1;
take_allscore();
end;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
var
rc : integer;//總步數
begin
runing := True;
Timer2.Interval := Tj;
rc := 12;
rc := rc + r;
rd := rd + 1;
n := 1 + n;
if (n >= rc) then //燈跑完後要做的事
begin
Timer2.Enabled := False;
Tj := 50;
rd := 1;
n := 0;
bi_bai_take_allscore();
end;
if (n > rc-12) then
begin
Tj := Tj + 50;//減速
PlaySound('R_1',hinstance,SND_ASYNC or SND_RESOURCE);
end;
m := m + 1;
if (m >= 3) then m := 1;
end;
procedure TForm1.take_allscore();
begin
case k of
1 : left_bai := 40;
2 : left_bai := 30;
3 : left_bai := 20;
end;
case k of
1 : right_bai := 10;
2 : right_bai := 20;
3 : right_bai := 15;
end;
case j of
1 : begin
if (bar_bet >= 1) then
begin
PlaySound('R_11',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := bar_bet * 100;
end;
end;
2 : begin
if (apple_bet >= 1) then
begin
PlaySound('R_18',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := apple_bet * 5;
end;
end;
3 : begin
if (Lemon_bet >= 1) then
begin
PlaySound('R_16',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := Lemon_bet * 2;
end;
end;
4 : begin
if (Lemon_bet >= 1) then
begin
PlaySound('R_16',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := Lemon_bet * right_bai;
end;
end;
5 : begin
if (Watermelon_bet >= 1) then
begin
PlaySound('R_14',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := Watermelon_bet * left_bai;
end;
end;
6 : begin
if (Watermelon_bet >= 1) then
begin
PlaySound('R_14',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := Watermelon_bet * 2;
end;
end;
7 : begin
take_score := 0;
end;
8 : begin
if (apple_bet >= 1) then
begin
PlaySound('R_18',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := apple_bet * 5;
end;
end;
9 : begin
if (Orange_bet >= 1) then
begin
PlaySound('R_17',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := Orange_bet * 2;
end;
end;
10 : begin
if (Orange_bet >= 1) then
begin
PlaySound('R_17',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := Orange_bet * right_bai;
end;
end;
11 : begin
if (bell_bet >= 1) then
begin
PlaySound('R_15',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := bell_bet * right_bai;
end;
end;
12 : begin
if (bell_bet >= 1) then
begin
PlaySound('R_15',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := bell_bet * 2;
end;
end;
13 : begin
if (seven_bet >= 1) then
begin
PlaySound('R_12',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := seven_bet * left_bai;
end;
end;
14 : begin
if (apple_bet >= 1) then
begin
PlaySound('R_18',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := apple_bet * 5;
end;
end;
15 : begin
if (apple_bet >= 1) then
begin
PlaySound('R_18',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := apple_bet * 2;
end;
end;
16 : begin
if (Lemon_bet >= 1) then
begin
PlaySound('R_16',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := Lemon_bet * right_bai;
end;
end;
17 : begin
if (star_bet >= 1) then
begin
PlaySound('R_13',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := star_bet * left_bai;
end;
end;
18 : begin
if (star_bet >= 1) then
begin
PlaySound('R_13',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := star_bet * 2;
end;
end;
19 : begin
take_score := 0;
end;
20 : begin
if (apple_bet >= 1) then
begin
PlaySound('R_18',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := apple_bet * 5;
end;
end;
21 : begin
if (seven_bet >= 1) then
begin
PlaySound('R_12',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := seven_bet * 2;
end;
end;
22 : begin
if (Orange_bet >= 1) then
begin
PlaySound('R_17',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := Orange_bet * right_bai;
end;
end;
23 : begin
if (bell_bet >= 1) then
begin
PlaySound('R_11',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := bell_bet * right_bai;
end;
end;
24 : begin
if (bar_bet >= 1) then
begin
PlaySound('R_18',hinstance,SND_ASYNC or SND_RESOURCE);
take_score := bar_bet * 50;
end;
end;
end;
runing := False;
bet_ok := False;;
re_bet := True;
bar_bet_full := False;
seven_bet_full := False;
star_bet_full := False;
Watermelon_bet_full := False;
bell_bet_full := False;
Lemon_bet_full := False;
Orange_bet_full := False;
apple_bet_full := False;
end;
procedure TForm1.bi_bai_take_allscore();
begin
case m of
1 : if (big_small = 1) then
begin
take_score := take_score * 2;
PlaySound('R_19',hinstance,SND_ASYNC or SND_RESOURCE);
end
else
begin
take_score := 0;
PlaySound('R_20',hinstance,SND_ASYNC or SND_RESOURCE);
end;
2 : if (big_small = 0) then
begin
take_score := take_score * 2;
PlaySound('R_19',hinstance,SND_ASYNC or SND_RESOURCE);
end
else
begin
take_score := 0;
PlaySound('R_20',hinstance,SND_ASYNC or SND_RESOURCE);
end;
end;
runing := False;
bet_ok := False;;
re_bet := True;
bar_bet_full := False;
seven_bet_full := False;
star_bet_full := False;
Watermelon_bet_full := False;
bell_bet_full := False;
Lemon_bet_full := False;
Orange_bet_full := False;
apple_bet_full := False;
end;
procedure TForm1.start_key();
begin
bet_all := bar_bet + seven_bet + star_bet + Watermelon_bet + bell_bet + Lemon_bet + Orange_bet + apple_bet;
if (not runing) then
begin
if (take_score >= 0) then
begin
score := take_score + score;
take_score := 0;
if (bar_bet >= 1) or (seven_bet >= 1) or (star_bet >= 1) or (Watermelon_bet >= 1) or
(bell_bet >= 1) or (Lemon_bet >= 1) or (Orange_bet >= 1) or (apple_bet >= 1) then
Begin
if re_bet then
begin
if (score >= bet_all) then
begin
score := score - bet_all;
bet_ok := True;
end
else
begin
bet_ok := False;
Exit;
end;
end;
if bet_ok then
begin
r := random(24);
Timer1.Enabled := True;
end;
end;
end;
end;
end;
procedure TForm1.FormMouseWheelDown(Sender: TObject; Shift: TShiftState;
MousePos: TPoint; var Handled: Boolean);
begin
if (bet_x > 14) and (bet_x < 55) and (bet_y > 492) and (bet_y < 546) then //--BAR 押分
begin
if (not runing) then
begin
if (score >= 1) then
begin
if re_bet then
begin
score := take_score + score;
take_score := 0;
bar_bet := 0;
seven_bet := 0;
star_bet := 0;
Watermelon_bet := 0;
bell_bet := 0;
Lemon_bet := 0;
Orange_bet := 0;
apple_bet := 0;
re_bet := False;
end
else
begin
if (bar_bet >= 99) then
begin
bar_bet_full := True;
end
else
begin
PlaySound('R_2',hinstance,SND_ASYNC or SND_RESOURCE);
score := score - 1;
bar_bet := bar_bet + 1;
bet_ok := True;
end;
end;
end;
end;
end;
if (bet_x > 61) and (bet_x < 101) and (bet_y > 492) and (bet_y < 546) then //--77 押分
begin
if (not runing) then
begin
if (score >= 1) then
begin
if re_bet then
begin
score := take_score + score;
take_score := 0;
bar_bet := 0;
seven_bet := 0;
star_bet := 0;
Watermelon_bet := 0;
bell_bet := 0;
Lemon_bet := 0;
Orange_bet := 0;
apple_bet := 0;
re_bet := False;
end
else
begin
if (seven_bet >= 99) then
begin
seven_bet_full := True;
end
else
begin
PlaySound('R_3',hinstance,SND_ASYNC or SND_RESOURCE);
score := score - 1;
seven_bet := seven_bet + 1;
bet_ok := True;
end;
end;
end;
end;
end;
if (bet_x > 109) and (bet_x < 149) and (bet_y > 492) and (bet_y < 546) then //--star 押分
begin
if (not runing) then
begin
if (score >= 1) then
begin
if re_bet then
begin
score := take_score + score;
take_score := 0;
bar_bet := 0;
seven_bet := 0;
star_bet := 0;
Watermelon_bet := 0;
bell_bet := 0;
Lemon_bet := 0;
Orange_bet := 0;
apple_bet := 0;
re_bet := False;
end
else
begin
if (star_bet >= 99) then
begin
star_bet_full := True;
end
else
begin
PlaySound('R_4',hinstance,SND_ASYNC or SND_RESOURCE);
score := score - 1;
star_bet := star_bet + 1;
bet_ok := True;
end;
end;
end;
end;
end;
if (bet_x > 155) and (bet_x < 197) and (bet_y > 492) and (bet_y < 546) then //--西瓜 押分
begin
if (not runing) then
begin
if (score >= 1) then
begin
if re_bet then
begin
score := take_score + score;
take_score := 0;
bar_bet := 0;
seven_bet := 0;
star_bet := 0;
Watermelon_bet := 0;
bell_bet := 0;
Lemon_bet := 0;
Orange_bet := 0;
apple_bet := 0;
re_bet := False;
end
else
begin
if (Watermelon_bet >= 99) then
begin
watermelon_bet_full := True;
end
else
begin
PlaySound('R_5',hinstance,SND_ASYNC or SND_RESOURCE);
score := score - 1;
watermelon_bet := watermelon_bet + 1;
bet_ok := True;
end;
end;
end;
end;
end;
if (bet_x > 203) and (bet_x < 243) and (bet_y > 492) and (bet_y < 546) then //--鈴鐺 押分
begin
if (not runing) then
begin
if (score >= 1) then
begin
if re_bet then
begin
score := take_score + score;
take_score := 0;
bar_bet := 0;
seven_bet := 0;
star_bet := 0;
Watermelon_bet := 0;
bell_bet := 0;
Lemon_bet := 0;
Orange_bet := 0;
apple_bet := 0;
re_bet := False;
end
else
begin
if (bell_bet >= 99) then
begin
bell_bet_full := True;
end
else
begin
PlaySound('R_6',hinstance,SND_ASYNC or SND_RESOURCE);
score := score - 1;
bell_bet := bell_bet + 1;
bet_ok := True;
end;
end;
end;
end;
end;
if (bet_x > 249) and (bet_x < 289) and (bet_y > 492) and (bet_y < 546) then //--檸檬 押分
begin
if (not runing) then
begin
if (score >= 1) then
begin
if re_bet then
begin
score := take_score + score;
take_score := 0;
bar_bet := 0;
seven_bet := 0;
star_bet := 0;
Watermelon_bet := 0;
bell_bet := 0;
Lemon_bet := 0;
Orange_bet := 0;
apple_bet := 0;
re_bet := False;
end
else
begin
if (lemon_bet >= 99) then
begin
lemon_bet_full := True;
end
else
begin
PlaySound('R_7',hinstance,SND_ASYNC or SND_RESOURCE);
score := score - 1;
lemon_bet := lemon_bet + 1;
bet_ok := True;
end;
end;
end;
end;
end;
if (bet_x > 297) and (bet_x < 337) and (bet_y > 492) and (bet_y < 546) then //--橘子 押分
begin
if (not runing) then
begin
if (score >= 1) then
begin
if re_bet then
begin
score := take_score + score;
take_score := 0;
bar_bet := 0;
seven_bet := 0;
star_bet := 0;
Watermelon_bet := 0;
bell_bet := 0;
Lemon_bet := 0;
Orange_bet := 0;
apple_bet := 0;
re_bet := False;
end
else
begin
if (orange_bet >= 99) then
begin
orange_bet_full := True;
end
else
begin
PlaySound('R_8',hinstance,SND_ASYNC or SND_RESOURCE);
score := score - 1;
orange_bet := orange_bet + 1;
bet_ok := True;
end;
end;
end;
end;
end;
if (bet_x > 344) and (bet_x < 384) and (bet_y > 492) and (bet_y < 546) then //--蘋果 押分
begin
if (not runing) then
begin
if (score >= 1) then
begin
if re_bet then
begin
score := take_score + score;
take_score := 0;
bar_bet := 0;
seven_bet := 0;
star_bet := 0;
Watermelon_bet := 0;
bell_bet := 0;
Lemon_bet := 0;
Orange_bet := 0;
apple_bet := 0;
re_bet := False;
end
else
begin
if (apple_bet >= 99) then
begin
apple_bet_full := True;
end
else
begin
PlaySound('R_9',hinstance,SND_ASYNC or SND_RESOURCE);
score := score - 1;
apple_bet := apple_bet + 1;
bet_ok := True;
end;
end;
end;
end;
end;
if bar_bet_full and seven_bet_full and star_bet_full and Watermelon_bet_full and bell_bet_full and Lemon_bet_full and Orange_bet_full and apple_bet_full then
begin
start_key();
end;
end;
procedure TForm1.FormDblClick(Sender: TObject);
begin
if (not runing) then
begin
if (score >= 1) then
begin
if (score >= 792) then
begin
if re_bet then
begin
score := take_score + score;
take_score := 0;
bar_bet := 0;
seven_bet := 0;
star_bet := 0;
Watermelon_bet := 0;
bell_bet := 0;
Lemon_bet := 0;
Orange_bet := 0;
apple_bet := 0;
re_bet := False;
end
else
&
目录
第一部分 基础篇
001 第一个C程序
002 运行多个源文件
003 求整数之积
004 比较实数大小
005 字符的输出
006 显示变量所占字节数
007 自增/自减运算
008 数列求和
009 乘法口诀表
010 猜数字游戏
011 模拟ATM(自动柜员机)界面
012 用一维数组统计学生成绩
013 用二维数组实现矩阵转置
014 求解二维数组的最大/最小元素
015 利用数组求前n个质数
016 编制万年历
017 对数组元素排序
018 任意进制数的转换
019 判断回文数
020 求数组前n元素之和
021 求解钢材切割的最佳订单
022 通过指针比较整数大小
023 指向数组的指针
024 寻找指定元素的指针
025 寻找相同元素的指针
026 阿拉伯数字转换为罗马数字
027 字符替换
028 从键盘读入实数
029 字符行排版
030 字符排列
031 判断字符串是否回文
032 通讯录的输入输出
033 扑克牌的结构表示
034 用“结构”统计学生成绩
035 报数游戏
036 模拟社会关系
037 统计文件的字符数
038 同时显示两个文件的内容
039 简单的文本编辑器
040 文件的字数统计程序
041 学生成绩管理程序
第二部分 数据结构篇
042 插入排序
043 希尔排序
044 冒泡排序
045 快速排序
046 选择排序
047 堆排序
048 归并排序
049 基数排序
050 二叉搜索树操作
051 二项式系数递归
052 背包问题
053 顺序表插入和删除
054 链表操作(1)
055 链表操作(2)
056 单链表就地逆置
057 运动会分数统计
058 双链表
059 约瑟夫环
060 记录个人资料
061 二叉树遍利
062 浮点数转换为字符串
063 汉诺塔问题
064 哈夫曼编码
065 图的深度优先遍利
066 图的广度优先遍利
067 求解最优交通路径
068 八皇后问题
069 骑士巡游
070 用栈设置密码
071 魔王语言翻译
072 火车车厢重排
073 队列实例
074 K阶斐波那契序列
第三部分 数值计算与趣味数学篇
075 绘制余弦曲线和直线的迭加
076 计算高次方数的尾数
077 打鱼还是晒网
078 怎样存钱以获取最大利息
079 阿姆斯特朗数
080 亲密数
081 自守数
082 具有abcd=(ab+cd)2性质的数
083 验证歌德巴赫猜想
084 素数幻方
085 百钱百鸡问题
086 爱因斯坦的数学题
087 三色球问题
088 马克思手稿中的数学题
089 配对新郎和新娘
090 约瑟夫问题
091 邮票组合
092 分糖果
093 波瓦松的分酒趣题
094 求π的近似值
095 奇数平方的有趣性质
096 角谷猜想
097 四方定理
098 卡布列克常数
099 尼科彻斯定理
100 扑克牌自动发牌
101 常胜将军
102 搬山游戏
103 兔子产子(菲波那契数列)
104 数字移动
105 多项式乘法
106 产生随机数
107 堆栈四则运算
108 递归整数四则运算
109 复平面作图
110 绘制彩色抛物线
111 绘制正态分布曲线
112 求解非线性方程
113 实矩阵乘法运算
114 求解线性方程
115 n阶方阵求逆
116 复矩阵乘法
117 求定积分
118 求满足特异条件的数列
119 超长正整数的加法
第四部分 图形篇
120 绘制直线
121 绘制圆
122 绘制圆弧
123 绘制椭圆
124 设置背景色和前景色
125 设置线条类型
126 设置填充类型和填充颜色
127 图形文本的输出
128 金刚石图案
129 飘带图案
130 圆环图案
131 肾形图案
132 心脏形图案
133 渔网图案
134 沙丘图案
135 设置图形方式下的文本类型
136 绘制正多边形
137 正六边形螺旋图案
138 正方形螺旋拼块图案
139 图形法绘制圆
140 递归法绘制三角形图案
141 图形法绘制椭圆
142 抛物样条曲线
143 Mandelbrot分形图案
144 绘制布朗运动曲线
145 艺术清屏
146 矩形区域的颜色填充
147 VGA256色模式编程
148 绘制蓝天图案
149 屏幕检测程序
150 运动的小车动画
151 动态显示位图
152 利用图形页实现动画
153 图形时钟
154 音乐动画
第五部分 系统篇
155 读取DOS系统中的国家信息
156 修改环境变量
157 显示系统文件表
158 显示目录内容
159 读取磁盘文件
160 删除目录树
161 定义文本模式
162 设计立体窗口
163 彩色弹出菜单
164 读取CMOS信息
165 获取BIOS设备列表
166 锁住硬盘
167 备份/恢复硬盘分区表
168 设计口令程序
169 程序自我保护
第六部分 常见试题解答篇
170 水果拼盘
171 小孩吃梨
172 删除字符串中的特定字符
173 求解符号方程
174 计算标准差
175 求取符合特定要求的素数
176 统计符合特定条件的数
177 字符串倒置
178 部分排序
179 产品销售记录处理
180 特定要求的字符编码
181 求解三角方程
182 新完全平方数
183 三重回文数
184 奇数方差
185 统计选票
186 同时整除
187 字符左右排序
188 符号算式求解
189 数字移位
190 统计最高成绩
191 比较字符串长度
192 合并整数
193 矩阵逆置
194 删除指定的字符
195 括号匹配
196 字符串逆置
197 SIX/NINE问题
198 单词个数统计
199 方差运算
200 级数运算
201 输出素数
202 素数题
203 序列排序
204 整数各位数字排序
205 字符串字母移位
206 Fibonacc数列
第七部分 游戏篇
207 商人过河游戏
208 吃数游戏
209 解救人质游戏
210 打字训练游戏
211 双人竞走游戏
212 迷宫探险游戏
213 迷你撞球游戏
214 模拟扫雷游戏
215 推箱子游戏
216 五子棋游戏
第八部分 综合实例篇
217 综合CAD系统
218 功能强大的文本编辑器
219 图书管理系统
220 进销存管理系统