home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / RADOOR30.ZIP / REVERCE.ZIP / REVERCE.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1994-04-12  |  19.7 KB  |  646 lines

  1. {$A+,B-,D-,E-,F-,I-,L-,N-,O-,R-,S+,V-}
  2. {$M 10000,0,0}
  3. {╔═════════════════════════════════════════════════════════════════════════╗
  4.  ║                                                                         ║
  5.  ║                   (c) CopyRight LiveSystems 1990, 1994                  ║
  6.  ║                                                                         ║
  7.  ║ Author    : Gerhard Hoogterp                                            ║
  8.  ║ FidoNet   : 2:282/100.5   2:283/7.33                                    ║
  9.  ║ BitNet    : GERHARD@LOIPON.WLINK.NL                                     ║
  10.  ║                                                                         ║
  11.  ║ SnailMail : Kremersmaten 108                                            ║
  12.  ║             7511 LC Enschede                                            ║
  13.  ║             The Netherlands                                             ║
  14.  ║                                                                         ║
  15.  ║        This module is part of the RADoor BBS doorwriters toolbox.       ║
  16.  ║                                                                         ║
  17.  ╚═════════════════════════════════════════════════════════════════════════╝}
  18. Program ReverceGame;
  19. Uses DOS,
  20.      CRT,
  21.      UOSys,      { UserOn Support                                }
  22.      Online,     { Online msgs support                           }
  23.      BBSTypes,   { Autodetect BBS Type. Default RA               }
  24.      UserHook,   { Demo/default userhook procedures              }
  25.      Filter,     { The default output filter                     }
  26.      LowLevel,   { The lowlevel stuff                            }
  27.      DoorSys,    { Misc. Door routines.                          }
  28.      GlobInfo,   { the global record with all the nessecary info }
  29.      RA,         { The RA init code                              }
  30.      SuperBBS,   { The SBBS init Code                            }
  31.      QuickBBS,   { The QBBS init code                            }
  32.      Fossil;     { The fossil routines + Timing. This is the     }
  33.                  {  body of the door!                            }
  34.  
  35.  
  36. {----------------------------------------------------------------------------|
  37.   The name and the version of the program together with the FossilObject
  38.   variable which every door needs.
  39. |----------------------------------------------------------------------------}
  40.  
  41.  
  42. Const  ProgramName    = 'REVERCE';
  43.        ProgramVersion = '1.0';
  44.        LastUpdate     = '10 May 1992';
  45.  
  46.        HelpFileName   = 'REVERCE.HLP';
  47.        Introfile      = 'Hi';
  48.        FinalFile      = 'Bye';
  49.  
  50. Var Foss       : FossilObject;
  51.     DoIt       : UserDoesObject;
  52.  
  53. {----------------------------------------------------------------------------|
  54.  Start here your own variables, procedures and functions.
  55. |----------------------------------------------------------------------------}
  56.  
  57. Type FieldType = Array[1..20] Of Byte;
  58.      FameRec   = Record
  59.                    Name  : String[35];
  60.                    Score : LongInt;
  61.                  End;
  62.  
  63. Var  StopGame : Boolean;
  64.      Key      : Char;
  65.      ErrorStr : String[40];
  66.  
  67.      PlayField : FieldType;
  68.      HowMany   : Byte;
  69.      LastScore : Integer;
  70.      TotalScore: LongInt;
  71.      Games     : Word;
  72.  
  73. {----------------------------------------------------------------------------|
  74.  Hall of fame procedure
  75. |----------------------------------------------------------------------------}
  76.  
  77. Var Hof     : Array[1..15] Of FameRec;
  78.     MaxHof  : Byte;
  79.  
  80. Procedure ReadHallOfFame;
  81. Var Inp : File;
  82. Begin
  83. FillChar(HOF,SizeOf(HOF),#00);
  84.  
  85. FileMode:=$42;
  86. Assign(Inp,GlobalInfo.HomeDir+'REVERCE.HOF');
  87. Reset(Inp,1);
  88. If IoResult<>0
  89.    Then Begin
  90.         Rewrite(Inp,1);
  91.         BlockWrite(Inp,HOF,SizeOf(HOF));
  92.         Seek(Inp,0);
  93.         End;
  94. BlockRead(Inp,HOF,SizeOf(Hof));
  95. Close(Inp);
  96. If IoResult<>0
  97.    Then;
  98. End;
  99.  
  100.  
  101. Procedure ShowHallOfFame(Var Foss : FossilObject);
  102. Var Count : Byte;
  103. Begin
  104. With Foss Do
  105.  Begin
  106.  ClrScrF;
  107.  WriteLnF('^4^!'+Center('-=( REVERCE Hall of Fame )=-')+'^0');
  108.  
  109.  WriteLnF('');
  110.  WriteF('^1'+MakeString(80,'─'));
  111.  WriteF('^4^!  1 '+Hof[1].Name+MakeString(60-Length(Hof[1].Name),' '));
  112.  WriteLnF(' ^4'+SL(HOF[1].Score,10));
  113.  WriteF('^1'+MakeString(80,'─')+'^0');
  114.  
  115.  For Count:=2 To 15 Do
  116.   Begin
  117.   WriteF(' ^2'+S(Count,2)+' ^3'+Hof[Count].Name+MakeString(60-Length(Hof[Count].Name),' '));
  118.   WriteLnF(' ^2'+SL(HOF[Count].Score,10));
  119.   End;
  120.  
  121.  For Count:=1 To GlobalInfo.ScreenLength-21 Do
  122.    WriteLnF('');
  123.  
  124.  WriteF('^1'+MakeString(80,'─'));
  125.  PressEnter;
  126.  End;
  127. End;
  128.  
  129. Function AddToHallOfFame(Name : RANameString;Score : LongInt):Boolean;
  130. Var Count : Byte;
  131.     Inp   : File;
  132. Begin
  133. AddToHallOfFame:=False;
  134. FileMode:=$42;
  135. Assign(Inp,GlobalInfo.HomeDir+'REVERCE.HOF');
  136. Reset(Inp,1);
  137. If IoResult<>0
  138.    Then FillChar(HOF,SizeOf(Hof),#00)
  139.    Else BlockRead(Inp,HOF,SizeOf(Hof));
  140.  
  141. Count:=1;
  142. While (HOF[Count].Score>Score) And (Count<=15) Do
  143.  Inc(Count);
  144.  
  145. If Count<=15
  146.    Then Begin
  147.         Move(HOF[COUNT],HOF[Count+1],((15-Count)-1)*SizeOf(HOF[1]));
  148.         HOF[Count].Name:=Name;
  149.         HOF[Count].Score:=Score;
  150.         AddToHallOfFame:=True;
  151.         Seek(Inp,0);
  152.         BlockWrite(Inp,HOF,SizeOf(Hof));
  153.         End;
  154.  
  155. Close(Inp);
  156. If IoResult<>0
  157.    Then { Nope.. Let's keep it simple }
  158. End;
  159.  
  160. {----------------------------------------------------------------------------|
  161.   Win and Lose sequences
  162. |----------------------------------------------------------------------------}
  163.  
  164. Procedure WinSequence(Var Foss : FossilObject;Turns : Word);
  165. Begin
  166. With Foss Do
  167.  Begin
  168.  ClrScrF;
  169.  WriteLnF('^4^!'+Center('-=( YOU HAVE WON! )=-')+'^0');
  170.  
  171.  WriteLnF('');
  172.  WriteLnF('');
  173.  WriteLnF('');
  174.  WriteLnF('^0Well.. let me see..');
  175.  WriteLnF('');
  176.  WriteLnF('    Numbers    : ^3 '+S(HowMany,0)+'^0');
  177.  WriteLnF('    Turns      : ^3 '+S(Turns,0)+'^0');
  178.  WriteLnF('');
  179.  WriteLnF('    Max score :  ^3 '+S(HowMany*10,0)+'^0');
  180.  WriteLnF('    Minus     :  ^3 '+S(Turns*5,0)+'^0');
  181.  
  182.  LastScore:=(HowMany*10) - (Turns*5);
  183.  WriteLnF('    Score     :  ^3 '+I(LastScore,0)+'^0');
  184.  WriteLnF('');
  185.  WriteLnF('^0Your previouse total was: ^3'+SL(TotalScore,0));
  186.  WriteLnF('^0Number of Games         : ^3'+S(Games,0));
  187.  TotalScore:=(TotalScore+LastScore);
  188.  WriteLnF('^0Which becomes (total+Score) = ^3'+SL(TotalScore,0));
  189.  WriteLnF('');
  190.  If TotalScore<0
  191.     Then WriteLn('Oh well.. keep on practicing...');
  192.  WriteLnF('');
  193.  PressEnter;
  194.  End;
  195. End;
  196.  
  197. Procedure LostSequence(Var Foss : FossilObject;Turns : Word);
  198. Begin
  199. With Foss Do
  200.  Begin
  201.  ClrScrF;
  202.  WriteLnF('^4^!'+Center('-=( you lost.. )=-')+'^0');
  203.  
  204.  WriteLnF('');
  205.  WriteLnF('');
  206.  WriteLnF('');
  207.  WriteLnF('^0Sorry, This is going to cost you points....');
  208.  WriteLnF('');
  209.  WriteLnF('    Max score :  ^3 '+S(HowMany*10,0)+'^0');
  210.  LastScore:=(HowMany*5)*-1;
  211.  WriteLnF('    Score     :  ^3 '+SL(LastScore,0)+'^0');
  212.  
  213.  WriteLnF('');
  214.  WriteLnF('^0Your previouse total was: ^3'+SL(TotalScore,0));
  215.  WriteLnF('^0Number of Games         : ^3'+S(Games,0));
  216.  TotalScore:=(TotalScore+LastScore);
  217.  WriteLnF('^0Which becomes total+Score = ^3'+SL(TotalScore,0));
  218.  WriteLnF('');
  219.  If TotalScore>0
  220.     Then WriteLn('Hmm.. Still a positive score!? WOW!');
  221.  WriteLnF('');
  222.  PressEnter;
  223.  End;
  224. End;
  225.  
  226.  
  227. {----------------------------------------------------------------------------|
  228.   Play Reverce procedures
  229. |----------------------------------------------------------------------------}
  230.  
  231.  
  232. Function AskNumberToPlay:Byte;
  233. Var NumberStr : String[2];
  234.     Number    : Byte;
  235. Begin
  236. Foss.InitInputFilter(NumCharSet);
  237.  
  238. Repeat
  239.   NumberStr:='';
  240.   Foss.WriteF('^3  How many numbers do you like to try? (5..20): ^6');
  241.   Foss.ReadLnF(NumberStr,2);
  242.   Number:=Str2Nr(NumberStr);
  243.   If Number in [0,5..20]
  244.      Then Foss.WriteLnF('^0')
  245.      Else Foss.WriteF(#13);
  246.  
  247. Until    Foss.Emergency
  248.       Or (Number=0)
  249.       Or (Number in [5..20]);
  250.  
  251. Foss.InitInputFilter(AllCharSet);
  252. AskNumberToPlay:=Number;
  253. End;
  254.  
  255. Function AskNumber:Byte;
  256. Var NumberStr : String[2];
  257.     Number    : Byte;
  258. Begin
  259. Foss.InitInputFilter(NumCharSet);
  260.  
  261. Repeat
  262.   NumberStr:='';
  263.   Foss.WriteF('^0 How many to reverce? (99 to quit): ^6');
  264.   Foss.ReadLnF(NumberStr,2);
  265.   Number:=Str2Nr(NumberStr);
  266.   If (Number<>99)
  267.      And (
  268.              (Number=0)
  269.           OR (Number>HowMany)
  270.          )
  271.      Then Foss.WriteF(#13)
  272.      Else Foss.WriteLnF('^0');
  273. Until    Foss.Emergency
  274.       Or (Number=99)
  275.       Or (    (Number>0)
  276.           And (Number<=HowMany)
  277.          );
  278. Foss.InitInputFilter(AllCharSet);
  279. AskNumber:=Number;
  280. End;
  281.  
  282. Procedure Reverce(Var Field : FieldType; Amount : Byte);
  283. Var TempField : FieldType;
  284.     Count     : Byte;
  285. Begin
  286. TempField:=Field;
  287. For Count:=1 To Amount Do
  288.  Field[Count]:=TempField[Amount-Count+1];
  289. End;
  290.  
  291. Procedure Shake(Var Field : FieldType);
  292. Var Count : Byte;
  293. Begin
  294. For Count:=1 To 50 Do
  295.  Reverce(Field,Random(HowMany)+1);
  296. End;
  297.  
  298. Procedure ShowField(Field : FieldType);
  299. Var Count : Byte;
  300. Begin
  301. Foss.WriteF('^2');
  302. For Count:=1 To HowMany Do
  303.  Foss.WriteF(S(Field[Count],2)+' ');
  304. End;
  305.  
  306. Function Win(Field : FieldType):Boolean;
  307. Var Temp : Boolean;
  308.     Count: Byte;
  309. Begin
  310. Temp:=True;
  311. Count:=0;
  312. Repeat
  313.   Inc(Count);
  314.   Temp:=Field[Count]=Count;
  315. Until (Not Temp)
  316.    Or (Count=HowMany);
  317. Win:=Temp;
  318. End;
  319.  
  320.  
  321. Procedure PlayReverce(Var Foss : FossilObject);
  322. Var Count     : Byte;
  323.     DoReverce : Byte;
  324.     Stop      : Boolean;
  325.     Skip      : Byte;
  326.     Turns     : Word;
  327. Begin
  328. With Foss Do
  329.  Begin
  330.  WriteLnF('');
  331.  WriteLnF('');
  332.  HowMany:=AskNumberToPlay;
  333.  If HowMany=0
  334.     Then Exit;
  335.  
  336.  ClrScrF;
  337.  WriteLnF('^4^!'+Center('-=( Play reverce )=-')+'^0');
  338.  WriteLnF('');
  339.  WriteLnF('');
  340.  
  341.  For Count:=1 To HowMany Do
  342.   PlayField[Count]:=Count;
  343.  
  344.  Shake(PlayField);
  345.  
  346.  Skip:=(80-(HowMany*3)) Div 2;
  347.  Turns:=0;
  348.  Inc(Games);
  349.  
  350.  Repeat
  351.   Case GlobalInfo.UseGraphics
  352.     OR GlobalInfo.UseAvatar   Of
  353.     True   : Begin
  354.              GotoXyF(Skip,7);
  355.              ShowField(PlayField);
  356.              GotoXyF(1,12);
  357.              WriteLnF('^!^0 Turn: ^3'+S(Turns+1,2));
  358.              DoReverce:=AskNumber;
  359.              End;
  360.     False  : Begin
  361.              ClrScrF;
  362.              WriteLnF('^4^!'+Center('-=( Play reverce )=-')+'^0');
  363.              For Count:=1 To 7 Do
  364.              WriteLnF('');
  365.              WriteF(MakeString(Skip,' '));
  366.              ShowField(PlayField);
  367.              For Count:=1 To 4 Do
  368.                 WriteLnF('');
  369.              WriteLnF(' Turn: '+S(Turns+1,2));
  370.              DoReverce:=AskNumber;
  371.              End;
  372.   End; {Case}
  373.  
  374.  Inc(Turns);
  375.  Stop:=(DoReverce=99);
  376.  If Not Stop
  377.     Then Reverce(PlayField,DoReverce);
  378.  Until Stop Or Win(PlayField) Or (Turns>(5*HowMany));
  379.  
  380.  If Not Stop
  381.     Then Begin
  382.          Case GlobalInfo.UseGraphics
  383.            OR GlobalInfo.UseAvatar   Of
  384.            True   : Begin
  385.                     GotoXyF(Skip,7);
  386.                     ShowField(PlayField);
  387.                     GotoXyF(1,13);
  388.                     WriteF('^!');
  389.                     End;
  390.            False  : Begin
  391.                     ClrScrF;
  392.                     WriteLnF('^4^!'+Center('-=( Play reverce )=-')+'^0');
  393.                     For Count:=1 To 7 Do
  394.                     WriteLnF('');
  395.                     WriteF(MakeString(Skip,' '));
  396.                     ShowField(PlayField);
  397.                     For Count:=1 To 5 Do
  398.                        WriteLnF('');
  399.                     End;
  400.          End; {Case}
  401.          End;
  402.  
  403.  IF Win(PlayField)
  404.     Then Begin
  405.          Foss.PressEnter;
  406.          WinSequence(Foss,Turns);
  407.          End
  408.     Else LostSequence(Foss,Turns);
  409.  
  410.  End; {With Foss}
  411. End;
  412.  
  413. Procedure HandleMail(Var Foss : FossilObject);
  414. Begin
  415. With Foss Do
  416.  Begin
  417.  ClrScrF;
  418.  WriteLnF('^4^!'+Center('-=( There''s mail for your )=-')+'^0');
  419.  WriteLnF('');
  420.  ReadMsg(Foss);
  421.  PressEnter;
  422.  End;
  423. End;
  424.  
  425.  
  426.  
  427.  
  428. {----------------------------------------------------------------------------|
  429.  Start of main module
  430. |----------------------------------------------------------------------------}
  431. Begin
  432.  
  433. WriteLn(ProgramName,' ',ProgramVersion,' (c) LiveSystems 1990,1991   ALL RIGHTS RESERVED,  NO GUARANTEES');
  434. WriteLn('Written by G.Hoogterp. E-mail address 2:283/1.2 Last Revision '+LastUpdate);
  435. WriteLn('Use Reverce -? to see commandline parameter summary.');
  436.  
  437. If ExistParameter('?')
  438.    Then Begin
  439.         WriteLn('Usage: ');
  440.         WriteLn;
  441.         WriteLn(' REVERCE.EXE [-T:<TimeLimit>] [-N:*N] [-P:*P] [-NOS]');
  442.         WriteLn;
  443.         WriteLn(' -T:     Limit the time available in the door.');
  444.         WriteLn(' -N:     Give nodenumber for multiline setups.');
  445.         WriteLn(' -P:     Give ComPort to use.');
  446.         WriteLn(' -NOS    Turn local sounds OFF for default.');
  447.         Halt;
  448.         End;
  449.  
  450. { The parameters mentioned here are read in the RA.PAS unit as they are more
  451.   or less RA dependend and the result has to be stuffed into the global info
  452.   record. }
  453.  
  454. {----------------------------------------------------------------------------|
  455.  Grab the BBS specific stuff into the GlobalInfo record
  456. |----------------------------------------------------------------------------}
  457.  
  458. Case CurrentBBStype Of
  459.  RA_BBS : InitRA;
  460.  S_BBS  : InitSBBS;
  461.  Q_BBS  : InitQBBS;
  462. End;
  463.  
  464. {----------------------------------------------------------------------------|
  465.  And let the LOGfile know who's talking.
  466. |----------------------------------------------------------------------------}
  467.  
  468. LogIt('Started: '+ProgramName+' '+ProgramVersion+' under '+GlobalInfo.BBSName);
  469.  
  470. {----------------------------------------------------------------------------|
  471.   Initialize the userhooks, Timeout detection etc.
  472. |----------------------------------------------------------------------------}
  473.  
  474. With GlobalInfo Do
  475.  Begin
  476.  Foss.AssignF(ComPort-1,BaudRate);   { Inti the fossil }
  477.  If Foss.Error<>0
  478.     Then Begin
  479.          WriteLn(#254' Couldn''t initialize fossil!');
  480.          LogIt('Couldn''t init fossil!');
  481.          Halt;
  482.          End;
  483.  
  484.  Foss.InitTimer(    { Init the timeout procedures              }
  485.                 3,  { Warning before pushed back to the BBS    }
  486.                 3   { Timeout time before and between warnings }
  487.                 );
  488.  
  489.  
  490.  Foss.InitOutputFilter(UsedFilter); { Set the output filter            }
  491.  Foss.InitInputFilter(AllCharSet);  { Set the input filter for ReadLnF }
  492.  
  493.  Foss.InitSysopKeys(SysopKeys);     { Set the SYSOP keys procedure     }
  494.  Foss.InitStatLine(StatusLine);     { Set the statusline procedure     }
  495.  
  496.  { Initialize the output filter using the info in the GlobalInfo record}
  497.  
  498.  InitUsedFilter(UseGraphics,UseAVATAR,LeftBracket,RightBracket,'^');
  499.  End;
  500.  
  501.  
  502. { Initialize the colortable, I only use these colors in ALL my programs}
  503.  
  504. ColorTable[0]:=LightCyan;           { Normal text color            }
  505. ColorTable[1]:=LightRed;            { Hotkey's                     }
  506. ColorTable[2]:=White;               { Userinput and info highlight }
  507. ColorTable[3]:=Yellow;              { Info                         }
  508. ColorTable[4]:=(Blue Shl 4)+White;  { Statusline color             }
  509. ColorTable[5]:=LightRed;            { Frames and lines             }
  510. ColorTable[6]:=(Red Shl 4)+White;   { Input fields                 }
  511.  
  512.  
  513. { and init the strings in the FOSSIL.PAS unit }
  514.  
  515. PressEnterOrStopString := '^0Press ^[^1ENTER^0^] to continue, ^[^1S^0^] to Stop: ^2';
  516. PressEnterString       := '^0Press ^[^1ENTER^0^] to continue: ^2';
  517. Warning1String         := '^1^[^2 You have only 2 minutes left!^1^]^2';
  518. Warning2String         := '^1^[^2 You have only 1 minute left! ^1^]^2';
  519. AttentionString        := 'HELLO???';
  520. LockOutString          := '^1--- You''ve been locked out of the system! Don''t call back..';
  521. HangUpString           := '^1--- The Sysop hungup the phone, call back an other time.';
  522. TimeUpString           := '^1Sorry, you reached your daily timelimit. Hope to see you back an other time.';
  523. UsedStopKey            := 'S';
  524.  
  525.  
  526. {----------------------------------------------------------------------------|
  527.   The mainbody of the DOOR goes here.
  528. |----------------------------------------------------------------------------}
  529.  
  530. Randomize;
  531. StopGame:=False;
  532. TotalScore:=0;
  533. LastScore:=0;
  534. Games:=0;
  535.  
  536. { UserOn support }
  537.  
  538. DoIt.Init('Is playing LiveSystems REVERCE.');
  539. DoIt.Setit;
  540.  
  541. { Read the hall of fame }
  542. ReadHallOfFame;
  543.  
  544.  
  545. { Start the main menu }
  546.  
  547. ErrorStr:='';
  548.  
  549. With Foss Do
  550.  Begin
  551.  Repeat
  552.    If ChkForMsg                { Check for online message }
  553.       Then HandleMail(Foss);
  554.  
  555.    ClrScrF;
  556.    WriteLnF('^4^!'+Center('-=( LiveSystems '+ProgramName+' '+ProgramVersion+' )=-'));
  557.    WriteLnF('^!'+Center('-=( Running at '+GlobalInfo.Systemname+' Node '+S(GlobalInfo.Node,0)+' )=-')+'^0');
  558.    WriteLnF('');
  559.  
  560.    If     (Games>0)
  561.       And (ErrorStr='')
  562.       Then WriteLnF('^3'+Center('--- Your score today: '+SL(TotalScore,0)+' ---')+'^0')
  563.       Else Begin
  564.            If ErrorStr<>''
  565.               Then WriteLnF('^1'+Center(ErrorStr)+'^0')
  566.               Else WriteLnF('');
  567.            ErrorStr:='';
  568.            End;
  569.  
  570.    WriteLnF('');
  571.    WriteLnF('');
  572.    WriteLnF('                          ^0^[^1F^0^] see the hall of Fame');
  573.    WriteLnF('                          ^0^[^1P^0^] Play the game');
  574.    WriteLnF('                          ^0^[^1H^0^] Help');
  575.    WriteLnF('                          ^0^[^1Q^0^] Quit back to BBS');
  576.    WriteLnF('');
  577.    WriteLnF('');
  578.      WriteF('  ^0Your choice: ^6');
  579.    Key:=Upcase(AskKey('FPHQ'#13,'Q'));
  580.    WriteLnF('^0');
  581.  
  582.    Case Key Of
  583.     'H'   : Begin { Help }
  584.             ClrScrF;
  585.             If ExistFile(GlobalInfo.HomeDir+HelpFileName)
  586.                Then ShowHelpFile(Foss,GlobalInfo.HomeDir+HelpFileName,
  587.                              '^4^!'+Center('-=( REVERCE help )=-')+'^0')
  588.                Else ErrorStr:='-- Sorry, no help available ---';
  589.             End;
  590.  
  591.     'P'   : Begin { Play }
  592.             PlayReverce(Foss);
  593.             If Games>=1
  594.                Then DoIt.ResetIt('Is playing LiveSystems REVERCE. (Score: '+SL(TotalScore,0)+')');
  595.             End;
  596.  
  597.     'Q'   : Begin { Quit }
  598.             If (Games>0) And AddToHallOfFame(GlobalInfo.UserName,TotalScore)
  599.                Then ShowHallOfFame(Foss);
  600.             StopGame:=True;
  601.             End;
  602.  
  603.     'F'   : ShowHallOfFame(Foss);
  604.    End; {Case}
  605.  Until StopGame;
  606.  End; {With Foss}
  607.  
  608. {----------------------------------------------------------------------------|
  609.   Finalize the DOOR and say a nice thank you to the user for spending his
  610.   online time and money on your door..
  611. |----------------------------------------------------------------------------}
  612.  
  613. Case CurrentBBSType Of
  614.  RA_BBS : If Not RAUpdateExitInfo
  615.              Then LogIt('Couldn''t update the EXITINFO.BBS!');
  616.  S_BBS  : If Not SBBSUpdateExitInfo
  617.              Then LogIt('Couldn''t update the EXITINFO.BBS!');
  618.  Q_BBS  : If Not QBBSUpdateExitInfo
  619.              Then LogIt('Couldn''t update the EXITINFO.BBS!');
  620. End;
  621.  
  622. Foss.ClrScrF;  { Clear the screen }
  623. Foss.WriteLnF('^2Thanks for using LiveSystems '+ProgramName+' '+ProgramVersion+'.');
  624. DoIt.ClearIt;
  625. Delay(1000);
  626.  
  627. {----------------------------------------------------------------------------|
  628.   Tell the LogFile that we're finished. Gives the fossil some extra time
  629.   to get the ThankYou out of it's mouth....
  630. |----------------------------------------------------------------------------}
  631.  
  632. LogIt('Stopped: '+ProgramName+' '+ProgramVersion);
  633.  
  634. {----------------------------------------------------------------------------|
  635.  And close the fossil again..
  636. |----------------------------------------------------------------------------}
  637.  
  638. Foss.CloseF;
  639. End.
  640.  
  641. {----------------------------------------------------------------------------|
  642.    And that's it! That's all.. I can't make things simpler..
  643.    Oh well, actualy I could, but not without giving up flexability and
  644.    usability.....
  645. |----------------------------------------------------------------------------}
  646.