home *** CD-ROM | disk | FTP | other *** search
- overlay procedure mycommand;
-
- var point,winlose,points,money,bet,die1,die2,dice:integer;
- quit:boolean;
-
- procedure rolldice;
- begin
- die1:=random(6)+1;
- die2:=random(6)+1;
- dice:=die1+die2;
- end;
-
- procedure cash;
- begin
- writeln;
- writeln ('You now have ',money,' dollars.');
- end;
-
- procedure getbet;
- begin
- quit:=false;
- repeat
- repeat
- write ('What is your bet for this round(0=end)? ');
- getstr;
- bet:=valu(input);
- if bet=0 then quit:=true;
- if bet=0 then bet:=money;
- until (bet<money+1) or (bet=0);
- until (bet>0) or quit;
- if quit then writeln ('Had enough I guess...') else
- writeln ('OK, you just bet ',bet,' dollars!');
- end;
-
- procedure craps;
- begin
- writeln ('Craps! You lose sucker...');
- money:=money-bet;
- end;
-
- procedure win;
- begin
- writeln ('We have a winner!');
- money:=money+bet;
- end;
-
- procedure intro;
- begin
- writeln ('You are now entering the realm of Craps.');
- writestr ('Do you wish instructions? *');
- if yes then printfile ('crapsins');
- end;
-
- procedure pointstomoney;
- begin
- repeat
- writeln ('You have ',urec.udpoints,' file points.');
- writeln ('How much would you like to convert to Cash?');
- getstr;
- points:=valu(input);
- until (points<=urec.udpoints) or (points=0) or hungupon;
-
- if points>3 then writeln (^B' Maximum stake is 3 points! ');
- if points>3 then exit;
- if money>150 then writeln (^B' Maximum Cash stake is 150');
- if money>150 then exit;
- if points>0 then money:=money+(points*50);
- if points>0 then urec.udpoints:=urec.udpoints-points;
- writeln ('You now have ',urec.udpoints,' file points.');
-
- end;
-
- procedure moneytopoints;
- begin
- writeln ('Converting your CASH to points!');
- Writeln ('You have ',money,' Money!. ');
- urec.udpoints:=urec.udpoints+money div 50;
- Writeln ('You now have ',urec.udpoints,' Points');
- money:=0;
- end;
-
- procedure convert;
-
- begin
- writeln ('Money Conversion!');
- writeln ('P] Points to money ');
- writeln ('C] Change money to points ');
- writeln ('Q] Quit');
- repeat
- q:=menu ('Bank','BANK','QPC');
- writeln;
- case q of
- 1:;
- 2:pointstomoney;
- 3:moneytopoints;
- end
- until (q=1) or hungupon;
- end;
-
- procedure crapsgame;
- var winlose:integer;
- begin
- intro;
- quit:=false;
- if money>0 then
- begin
- repeat
- cash;
- bet:=0;
- getbet;
- if not quit then
- begin
- write ('Now rolling your point:');
- rolldice;
- writeln ('It''s a:',dice);
- winlose:=0;
- if dice=7 then winlose:=2;
- if dice=11 then winlose:=2;
- if winlose=2 then win else begin
- point:=dice;
- writeln ('OK, you''ve made it this far, now try and get another ',dice,' to win!');
- begin
- repeat
- winlose:=0;
- rolldice;
- writeln ('You got a ',dice);
- if dice=7 then winlose:=1;
- if dice=11 then winlose:=1;
- if dice=point then winlose:=2;
- until (winlose>0) or hungupon;
- end;
- if winlose=2 then win;
- if winlose=1 then craps;
- end;
- end;
- if money<1 then quit:=true;
- until quit or hungupon;
- end;
- if money<1 then writeln ('That''s too bad, you''re out of cash! Try going to the bank!');
- writeln ('Thanks you for playing Craps.');
- end;
-
-
- begin
- money:=0;
- writeln (^B'Now entering the Gambling section!');
- writeln ('C] Play Craps! ');
- writeln ('B] Go to the BANK. ');
- writeln ('Q] Quit');
- repeat
- q:=menu ('Game','GAME','CBQ');
- writeln;
- case q of
- 1:crapsgame;
- 2:convert;
- 3:;
- end
- until (q=3) OR HUNGUPON;
- moneytopoints;
- end;