home *** CD-ROM | disk | FTP | other *** search
/ Jason Aller Floppy Collection / 189.img / TCS120S.ZIP / MYCOMMAN.INC < prev    next >
Text File  |  1989-01-27  |  5KB  |  123 lines

  1. {$R-,S-,I-,D-,F-,V-,B-,N-,L+ }
  2. {$M 65500,0,0 }
  3.  
  4. unit mycomman;
  5.  
  6. interface
  7.  
  8. uses crt,dos,
  9.      gentypes,configrt,modem,statret,gensubs,subs1,windows,subs2,textret,
  10.      mailret,userret,flags,mainr1,ansiedit,lineedit,chatstuf,
  11.      mainr2,overret1;   { that's everything! }
  12.  
  13.  
  14. procedure mycommand;
  15.  
  16. implementation
  17.  
  18. procedure mycommand;
  19. var a,b,c,d,x,y,z,correct,stake,guess : integer;
  20. begin
  21.  
  22.      writehdr ('User Utilities');
  23.      writeln;
  24.      writeln ('You have '^S,urec.timeinstorage,^R' minutes in storage.');
  25.      writeln (^M'You have '^S,urec.timetoday,^R' minute left today.');
  26.      writeln (^M,'You have '^S,urec.udpoints,^R' file points.');
  27.      writeln (^M^P'You can do:');
  28.      if usetimebank then
  29.       writeln (^R' [1] Deposit Time in Time Bank');
  30.      if usetimebank then
  31.       writeln (^R' [2] Withdraw Time from Time Bank');
  32.      if usegamble then
  33.       writeln (^R' [3] Gamble ''Guess The Number''');
  34.      if useconvertfiletotime then
  35.       writeln (^R' [4] Convert File Points to Time');
  36.      if useconverttimetofile then
  37.      writeln (^R' [5] Convert Time to File Points');
  38.      writestr (^P'Choice [C/R Quits]: *');
  39.       a:=valu(input);
  40.       case a of
  41.        1 : begin
  42.             writestr ('How much time do you wish to store? *');
  43.              d:=valu(input);
  44.               if d>maxdeposit then begin
  45.                 writeln ('Sorry, you may only deposit '^S,maxdeposit,^R' minutes');
  46.                 exit;
  47.                end;
  48.               if d>urec.timetoday then begin
  49.                 writeln ('You only have '^S,urec.timetoday,^R' minutes left!');
  50.                 exit;
  51.                end;
  52.              urec.timeinstorage:=urec.timeinstorage+d;
  53.              urec.timetoday:=urec.timetoday-d;
  54.              writeln ('You now have '^S,urec.timeinstorage,^R' minutes in storage.');
  55.             end;
  56.        2 : begin
  57.             writestr ('How much time do you wish to withdraw? *');
  58.             d:=valu(input);
  59.              if d>urec.timeinstorage then begin
  60.               writeln ('You only have '^S,urec.timeinstorage,^R' minutes in storage!');
  61.               exit;
  62.              end;
  63.             urec.timetoday:=urec.timetoday+d;
  64.             urec.timeinstorage:=urec.timeinstorage-d;
  65.              writeln ('You now have '^S,urec.timetoday,^R' minutes left.');
  66.              writeln ('You have '^S,urec.timeinstorage,^R' minutes left in storage.');
  67.              writestr ('Use User Utilites agian? *');
  68.             end;
  69.         3 : begin
  70.               writeln ('You have '^S,urec.udpoints,^R' points to gamble with.');
  71.               writeln ('Ok, I pick a number between 1 and 20, you have two guesses to guess it.');
  72.                 correct:=random(20)+1;
  73.                 writeln;
  74.                 writestr ('How many points do you want to gamble [C/R Quits]? *');
  75.                  stake:=valu(input);
  76.                   if stake=0 then exit;
  77.                   writestr ('Guess #1: *');
  78.                    guess:=valu(input);
  79.                   if guess=correct then begin
  80.                    writeln ('Congradulations!, you won '^S,stake,^R' points!');
  81.                     urec.udpoints:=urec.udpoints+stake;
  82.                     writeln ('You now have '^S,urec.udpoints,^R' file points!');
  83.                  exit;
  84.                  end;
  85.              if correct>guess then
  86.                writeln ('The correct answer is higher.');
  87.              if correct<guess then
  88.                writeln ('The correct answer is lower.');
  89.               writestr ('Final Guess: *');
  90.              guess:=valu(input);
  91.              if guess=correct then begin;
  92.               writeln ('Congradulations!, you won '^S,stake,^R' points!');
  93.               urec.udpoints:=urec.udpoints+stake;
  94.               writeln ('You now have '^S,urec.udpoints,^R' file points!');
  95.                exit;
  96.               end;
  97.                writeln ('I am sorry, you have lost.');
  98.                urec.udpoints:=urec.udpoints-stake;
  99.               writeln ('You now have '^S,urec.udpoints,^R' left');
  100.              exit;
  101.              end;
  102.         4 : begin
  103.               if urec.udpoints=0 then begin
  104.                 writeln ('You must have file points!!');
  105.                 exit;
  106.                end;
  107.              writestr ('Turn how many file points into time 1 pt=- minutes): *');
  108.              z:=valu(input);
  109.              if z>urec.udpoints then begin
  110.               writeln ('You only have '^S,urec.udpoints,^R' file points!!');
  111.               exit;
  112.              end;
  113.              x:=z*filepointworth;
  114.              urec.timetoday:=urec.timetoday+x;
  115.              writeln ('You have '^S,urec.timetoday,^R' minutes left today.');
  116.              writeln ('You now have '^S,urec.udpoints,^R' left.');
  117.             exit;
  118.            end;
  119.           end;
  120. begin
  121. end;
  122. end;
  123. end.