home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Jason Aller Floppy Collection
/
189.img
/
TCS120S.ZIP
/
MYCOMMAN.INC
< prev
next >
Wrap
Text File
|
1989-01-27
|
5KB
|
123 lines
{$R-,S-,I-,D-,F-,V-,B-,N-,L+ }
{$M 65500,0,0 }
unit mycomman;
interface
uses crt,dos,
gentypes,configrt,modem,statret,gensubs,subs1,windows,subs2,textret,
mailret,userret,flags,mainr1,ansiedit,lineedit,chatstuf,
mainr2,overret1; { that's everything! }
procedure mycommand;
implementation
procedure mycommand;
var a,b,c,d,x,y,z,correct,stake,guess : integer;
begin
writehdr ('User Utilities');
writeln;
writeln ('You have '^S,urec.timeinstorage,^R' minutes in storage.');
writeln (^M'You have '^S,urec.timetoday,^R' minute left today.');
writeln (^M,'You have '^S,urec.udpoints,^R' file points.');
writeln (^M^P'You can do:');
if usetimebank then
writeln (^R' [1] Deposit Time in Time Bank');
if usetimebank then
writeln (^R' [2] Withdraw Time from Time Bank');
if usegamble then
writeln (^R' [3] Gamble ''Guess The Number''');
if useconvertfiletotime then
writeln (^R' [4] Convert File Points to Time');
if useconverttimetofile then
writeln (^R' [5] Convert Time to File Points');
writestr (^P'Choice [C/R Quits]: *');
a:=valu(input);
case a of
1 : begin
writestr ('How much time do you wish to store? *');
d:=valu(input);
if d>maxdeposit then begin
writeln ('Sorry, you may only deposit '^S,maxdeposit,^R' minutes');
exit;
end;
if d>urec.timetoday then begin
writeln ('You only have '^S,urec.timetoday,^R' minutes left!');
exit;
end;
urec.timeinstorage:=urec.timeinstorage+d;
urec.timetoday:=urec.timetoday-d;
writeln ('You now have '^S,urec.timeinstorage,^R' minutes in storage.');
end;
2 : begin
writestr ('How much time do you wish to withdraw? *');
d:=valu(input);
if d>urec.timeinstorage then begin
writeln ('You only have '^S,urec.timeinstorage,^R' minutes in storage!');
exit;
end;
urec.timetoday:=urec.timetoday+d;
urec.timeinstorage:=urec.timeinstorage-d;
writeln ('You now have '^S,urec.timetoday,^R' minutes left.');
writeln ('You have '^S,urec.timeinstorage,^R' minutes left in storage.');
writestr ('Use User Utilites agian? *');
end;
3 : begin
writeln ('You have '^S,urec.udpoints,^R' points to gamble with.');
writeln ('Ok, I pick a number between 1 and 20, you have two guesses to guess it.');
correct:=random(20)+1;
writeln;
writestr ('How many points do you want to gamble [C/R Quits]? *');
stake:=valu(input);
if stake=0 then exit;
writestr ('Guess #1: *');
guess:=valu(input);
if guess=correct then begin
writeln ('Congradulations!, you won '^S,stake,^R' points!');
urec.udpoints:=urec.udpoints+stake;
writeln ('You now have '^S,urec.udpoints,^R' file points!');
exit;
end;
if correct>guess then
writeln ('The correct answer is higher.');
if correct<guess then
writeln ('The correct answer is lower.');
writestr ('Final Guess: *');
guess:=valu(input);
if guess=correct then begin;
writeln ('Congradulations!, you won '^S,stake,^R' points!');
urec.udpoints:=urec.udpoints+stake;
writeln ('You now have '^S,urec.udpoints,^R' file points!');
exit;
end;
writeln ('I am sorry, you have lost.');
urec.udpoints:=urec.udpoints-stake;
writeln ('You now have '^S,urec.udpoints,^R' left');
exit;
end;
4 : begin
if urec.udpoints=0 then begin
writeln ('You must have file points!!');
exit;
end;
writestr ('Turn how many file points into time 1 pt=- minutes): *');
z:=valu(input);
if z>urec.udpoints then begin
writeln ('You only have '^S,urec.udpoints,^R' file points!!');
exit;
end;
x:=z*filepointworth;
urec.timetoday:=urec.timetoday+x;
writeln ('You have '^S,urec.timetoday,^R' minutes left today.');
writeln ('You now have '^S,urec.udpoints,^R' left.');
exit;
end;
end;
begin
end;
end;
end.