Advertisement
WadeRollins2710

[Game] [Casino] HOT! HOT! HOT!

Feb 3rd, 2015
298
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 10.92 KB | None | 0 0
  1. {You need a file named 'PROFILE.TXT' contains number 1000}
  2. Program Roll_The_Dice;
  3. Uses crt;
  4. Var
  5.    Money, i, l: LongInt;
  6.    f: Text;
  7.    Age: Word;
  8.    Name: String;
  9. Function Up(m: String): String;
  10.          Begin
  11.               For i:=1 to length(m) do
  12.                Begin
  13.                   m[i]:=Upcase(m[i]);
  14.                End;
  15.               Up:=m;
  16.          End;
  17. Procedure Set_up_screen;
  18.           Begin
  19.                TextBackGround(White);
  20.                For i:=1 to 25 do
  21.                    Begin
  22.                         Write('                                                         ');
  23.                         Writeln('                      ');
  24.                    End;
  25.                gotoxy(1,1);
  26.                TextColor(Black);
  27.           End;
  28. Procedure Welcome;
  29.           Var
  30.              Answer, St: String;
  31.              n, m, RandX, RandY, RandString: Integer;
  32.           Begin
  33.                St:='YOUUUUUUUUUUUUUUUUUU!!!!!!';
  34.                Writeln('Hey!'); Delay(1000);
  35.                Writeln('Welcome to the casino in DOS!'); Delay(1000);
  36.                Writeln('I''m Mr.Bot- your instructor'); Delay(1000);
  37.                Writeln('Are you new here? '); Readln(Answer);
  38.                While (Up(Answer)<>'YES') and (Up(Answer)<>'NO') and (Up(Answer)<>'666') and
  39.                      (Up(Answer)<>'USERNAME 666') do
  40.                      Begin
  41.                           Writeln('I don''t understand your command'); Delay(1000);
  42.                           Write('Say again pls :) : ');
  43.                           Readln(Answer);
  44.                      End;
  45.                While Answer='Username 666' do
  46.                   Begin
  47.                        For i:=1 to 3 do
  48.                           Begin
  49.                            clrscr;
  50.                            Write('.'); Delay(750);
  51.                            Write('.'); Delay(750);
  52.                            Write('.'); Delay(750);
  53.                            clrscr;
  54.                           End;
  55.                        Write('I...'); Delay(1000);
  56.                        Write('I don''t know what...'); Delay(1000);
  57.                        Writeln('what are you talking about');
  58.                        Write('Say...'); Delay(1000); Write('Say again pls: ');
  59.                        Readln(Answer);
  60.                   End;
  61.                If Answer='666' then
  62.                   Begin
  63.                        Clrscr;
  64.                        TextBackGround(Red);
  65.                        For i:=1 to 25 do
  66.                           Begin
  67.                            Write('                                                ');
  68.                            Writeln('                                      ');
  69.                           End;
  70.                        TextColor(LightRed);
  71.                        Gotoxy(1,1);
  72.                        Writeln('I''M '); Delay(1000); Writeln('GONNA.......'); Delay(1000);
  73.                        Write('K'); Delay(750); Write('I'); Delay(750);
  74.                        Write('L'); Delay(750); Write('L ');
  75.                        Delay(1000);
  76.                        For i:=1 to length(St) do
  77.                            Begin
  78.                                 Write(St[i]); Delay(500);
  79.                            End;
  80.                        Delay(1000);
  81.                        Randomize;
  82.                        RandX:=25; RandY:=80;
  83.                        RandString:=8;
  84.                        For i:=1 to 40 do
  85.                            Begin
  86.                                 n:=Random(RandX)+1;
  87.                                 m:=Random(RandY)+1;
  88.                                 Gotoxy(m,n);
  89.                                 Case Random(RandString)+1 of
  90.                                      1: St:='DIE! DIE! DIE! DIE! DIE! DIE!';
  91.                                      2: St:='666 666 666 666';
  92.                                      3: St:='SL#!?ER M@N 1~ G01n% t0 K1*L Y&$';
  93.                                      4: St:='Mr.BOT is not so nice    He is E@%?!';
  94.                                      5: St:='You discoverd it yet??? ';
  95.                                      6: St:='KILL...........';
  96.                                      7: St:='No one can escape';
  97.                                      8: St:='From@)#@(this@#@%? DOS';
  98.                                 End;
  99.                                 Write(St);
  100.                                 Delay(300);
  101.                            End;
  102.                        Halt;
  103.                  End;
  104.                If Answer='yes' then
  105.                   Begin
  106.                        Writeln('OK! Let''s make a profile for you so you can play here!');
  107.                        Write('Input your name: '); Readln(Name);
  108.                        Write('Input your age: '); Readln(Age);
  109.                        If Age<18 then
  110.                           Begin
  111.                                Writeln('Oops you aren''t old enough to join the casino'); Delay(1500);
  112.                                Writeln('I''m so sorry :('); Delay(1500);
  113.                                Writeln('Come back when you are old enough'); Delay(1500);
  114.                                Halt;
  115.                           End;
  116.                        Writeln('Ok! Here are your money: 1000$'); Delay(1000);
  117.                        Writeln('Press enter when you are ready');
  118.                        Readln;
  119.                        Assign(f,'PROFILE.TXT');
  120.                        Rewrite(f);
  121.                        Write(f,1000);
  122.                        Close(f);
  123.                   end;
  124.                If Answer='no' then
  125.                   Begin
  126.                        Writeln('Ok! You gonna use the old profile!');
  127.                        Delay(1000);
  128.                   End;
  129.           End;
  130. Procedure Cout(m: String);
  131.           Begin
  132.                Writeln(m);
  133.                Delay(2000);
  134.           End;
  135. Procedure Intro;
  136.           Begin
  137.                Cout('Here are the rules: ');
  138.                Cout('There are you and "the house"');
  139.                Cout('You choose the bet');
  140.                Cout('The house will rolls 3 dices, so will you');
  141.                Cout('If the number on your dices is higher, you will win and earn money!');
  142.                Cout('Else, you will lose and lose money');
  143.                Cout('How much will you earn or lose money is based on your bet');
  144.                Write('Understood and ready? Press any key to play now! :D ');
  145.                Repeat Until KeyPressed;
  146.           End;
  147. Procedure Loading_Screen;
  148.           Begin
  149.                clrscr;
  150.                Randomize;
  151.                For i:=1 to random(2)+2 do
  152.                    Begin
  153.                         Write('Loading'); Delay(500);
  154.                         clrscr;
  155.                         Write('Loading.'); Delay(500);
  156.                         clrscr;
  157.                         Write('Loading..'); Delay(500);
  158.                         clrscr;
  159.                         Write('Loading...'); Delay(500);
  160.                         clrscr;
  161.                    End;
  162.           End;
  163. Procedure Play;
  164.           Var
  165.              Rand, Dice1, Dice2, x, y, z: Byte;
  166.              Bet, Result: LongInt;
  167.              Ans: String;
  168.           Begin
  169.                clrscr;
  170.                Randomize;
  171.                Rand:=6;
  172.                Assign(f,'PROFILE.TXT'); Reset(f);
  173.                Read(f,Money);
  174.                Close(f);
  175.            Repeat
  176.                Write('Choose your bet: '); Readln(Bet);
  177.                While Bet>Money do
  178.                      Begin
  179.                           Cout('What?! The bet is higher then your money!');
  180.                           Write('We can let you do that! Pls choose again: ');
  181.                           Readln(Bet);
  182.                      End;
  183.                Cout('OK! Let''s play!');
  184.                clrscr;
  185.                Writeln('The house is rolling the dice...');
  186.                For i:=1 to 300 do
  187.                    Begin
  188.                         Dice1:=0; x:=Random(Rand)+1; y:=Random(Rand)+1; z:=Random(Rand)+1;
  189.                         Write(x,' '); Dice1:=Dice1+x;
  190.                         Write(y,' '); Dice1:=Dice1+y;
  191.                         Write(z,' '); Dice1:=Dice1+z;
  192.                         Gotoxy(1,2);
  193.                         Delay(10);
  194.                    End;
  195.                Gotoxy(6,2);Writeln(' = ',Dice1);
  196.                Delay(1000);
  197.                Writeln('You are rolling the dice...');
  198.                For i:=1 to 300 do
  199.                    Begin
  200.                         Dice2:=0; x:=Random(Rand)+1; y:=Random(Rand)+1; z:=Random(Rand)+1;
  201.                         Write(x,' '); Dice2:=Dice2+x;
  202.                         Write(y,' '); Dice2:=Dice2+y;
  203.                         Write(z,' '); Dice2:=Dice2+z;
  204.                         Gotoxy(1,4);
  205.                         Delay(10);
  206.                    End;
  207.                Gotoxy(6,4); Writeln(' = ',Dice2);
  208.                Writeln;
  209.                Delay(500);
  210.                If Dice1<Dice2 then
  211.                   Begin
  212.                        Cout('Congrats! you won!');
  213.                        Money:=Money+Bet*(Dice2-Dice1);
  214.                        Writeln('You earned ',Bet*(Dice2-Dice1)); Delay(1000);
  215.                        Writeln('Your money: ', Money); Delay(1000);
  216.                   End;
  217.                If Dice1>Dice2 then
  218.                   Begin
  219.                        Cout('Ohhh! you lost!');
  220.                        Money:=Money-Bet*(Dice1-Dice2);
  221.                        Writeln('You lost ',abs(Bet*(Dice2-Dice1))); Delay(1000);
  222.                        If Money>0 then
  223.                           Begin
  224.                                   Writeln('Your money: ', Money); Delay(1000);
  225.                           End
  226.                           else
  227.                               Begin
  228.                                    Cout('You lost all of your money! :''(');
  229.                                    Cout('I''m so sorry! Come back later! :(');
  230.                                    Assign(f,'PROFILE.TXT');
  231.                                    Rewrite(f);
  232.                                    Write(f,1000);
  233.                                    Close(f);
  234.                                    Halt;
  235.                               End;
  236.                   End;
  237.                If Dice1=Dice2 then
  238.                   Begin
  239.                        Cout('It''s a tie!');
  240.                        Cout('Your money won''t be changed.');
  241.                        Writeln('Your money: ',Money); Delay(1000);
  242.                   End;
  243.                Write('Do you want to continue?? '); Readln(Ans);
  244.                clrscr;
  245.        Until Up(Ans)='NO';
  246.                Assign(f,'PROFILE.TXT');
  247.                Rewrite(f);
  248.                Write(f,Money);
  249.                Close(f);
  250.                Cout('Ok! Thanks you so much for playing! :) ');
  251.                Cout('Your profile have been saved!');
  252.                Cout('Hope you gonna visit the DOS Casino again!');
  253.                Cout('Good bye and wish you luck everytime! ');
  254.           End;
  255. Begin
  256.      clrscr;
  257.      Set_Up_Screen;
  258.      Welcome;
  259.      Intro;
  260.      Loading_Screen;
  261.      Play;
  262. End.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement