home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0950.lha / BBDoors / BBDoors65.lha / rexxDoors / Horse_Racing.rexx < prev    next >
OS/2 REXX Batch file  |  1993-10-18  |  24KB  |  676 lines

  1. /***********************************************************************/
  2. /*                BBS DOWNS! (V2.01d for BBBBS, 18 Oct 93)              */
  3. /***********************************************************************/
  4. /*     A horse race pfile written in Arexx for the Amiga Cnet BBS!     */
  5. /*                                                                     */
  6. /*     Brought to you by Lori Bogan and Gene Ponce, sysops of....      */
  7. /*                                                                     */
  8. /*                   Superboard Two (702) 423-7206                     */
  9. /*                                                                     */
  10. /*         Converted for Tempest & Modified by Sean Kelly              */
  11. /*                                                                     */
  12. /*                           Amizon BBS                                */
  13. /*                                                                     */
  14. /*                          312-594-1146                               */
  15. /*                                                                     */
  16. /* This program is based on another program called "Horses" which was  */
  17. /* written in C for the Tag BBS.  While this program is not a direct   */
  18. /* porting of the "Horses" program, we would still like to credit the  */
  19. /* author of "Horses", D.Budzitowski, for many of the concepts we have */
  20. /* used in this pfile!                                                 */
  21. /***********************************************************************/
  22. /*                    A FEW NOTES TO OTHER SYSOPS                      */
  23. /***********************************************************************/
  24. /*  1. With this door you should also have an accompanying file called */
  25. /*     Dinstuct which is called when the user asks for instructions.   */
  26. /*     If that file is not present you can make a simple text file to  */
  27. /*     to be used or do nothing since the program will still  run      */
  28. /*     without the Dinstruct file.                                     */
  29. /*  2. You will need to change the variables below (under the comment  */
  30. /*     *BBS variable initialization*) to suit your configuration.      */
  31. /***********************************************************************/
  32. /*                       VARIABLE DECLARATIONS                         */
  33. /***********************************************************************/
  34. /* BBSname   = name of the BBS this pfile is being run on              */
  35. /* Sysopname = name of the sysop offering this pfile                   */
  36. /* Progname  = name of this program                                    */
  37. /* FilePath  = path to subdirectory for support files                  */
  38. /* input     = used in CHECKPANIC procedure to hold input argument     */
  39. /* Uhandle   = Handle of current player                                */
  40. /* Udate     = Current date & time                                     */
  41. /* Uaccess   = User's access number (0,23)                             */
  42. /* CLS       = User's screen clear code                                */
  43. /* AcctBal   = Current player's account balance                        */
  44. /* LowBal    = Flag to signal when player's acct balance is too low    */
  45. /* MaxPlayers= Maximum players allowed                                 */
  46. /* player.i  = 'array' to hold all player handles                      */
  47. /* score.i   = 'array' to hold all player acct balances                */
  48. /* i, j      = simple counters used in various places in program       */
  49. /* temp      = temporary variable used when sorting/swapping           */
  50. /* nplayers  = total number of players in Dplayers files               */
  51. /* Flag      = used to signal different events                         */
  52. /* More      = used to ask if user wants to see more of the score list */
  53. /* Choice    = main menu choice                                        */
  54. /* Another   = does player want to bet on ANOTHER race?                */
  55. /* Hname.i   = horse names                                             */
  56. /* WHorse.i  = horse(s) picked to win, show or place                   */
  57. /* WBet.i    = amount bet to win, show or place                        */
  58. /* WOdds.i   = holds the current "To win" odds on the horses           */
  59. /* POdds.i   = holds the current "To place" odds on the horses         */
  60. /* SOdds.i   = holds the current "To show" odds on the horses          */
  61. /* RNum      = holds random numbers picked for horse race              */
  62. /* Count.i   = holds the cumulative counter for each horse during race */
  63. /* Win       = holds number of WIN horse                               */
  64. /* Place     = holds number of PLACE horse                             */
  65. /* Show      = holds number of Show horse                              */
  66. /***********************************************************************/
  67. /*                       VARIABLE INITIALIZATIONS                      */
  68. /***********************************************************************/
  69.  
  70.   options results
  71.   PARSE arg name winnings . colorflag secs .
  72.   IF ~DATATYPE(secs,'N') THEN secs=3600
  73.  
  74.   FF='0C'x  /* FormFeed */
  75.   CR='0D'x  /* Carraige Return */
  76.  
  77.   CALL TIME('R')
  78.   SIGNAL ON BREAK_C
  79.   SIGNAL ON BREAK_E
  80.  
  81. /*Program error handling */
  82.   SIGNAL ON syntax      /* if a syntax error occurs goto syntax:      */
  83.  
  84. /**********************************************************************/
  85. /*                        BBS VARIABLES                               */
  86. /**********************************************************************/
  87.  
  88.  
  89.   info= 's:CONFIG.BBS'
  90.   IF ~EXISTS(info) THEN info='BBS:BBS_TEXT/CONFIG.BBS'
  91.   call open(con,info,'R')
  92.   IF con=0 THEN EXIT 666
  93.   lynes.1=readln(con)
  94.   compos=POS('/*',lynes.1)
  95.   IF compos>0 THEN lynes.1=LEFT(lynes.1,compos-1)
  96.   bbsname=STRIP(lynes.1)
  97.   lynes.2=readln(con)
  98.   sysopname=WORD(lynes.2,1)
  99.   call close(con)
  100.   Progname = 'BBS Downs!'
  101.   MaxPlayers = 100        /* max number of players allowed by sysop */
  102.   bbspath=GETCLIP('BBS_path')
  103.   bbspath=bbspath'rexxDoors/Data/'
  104.   Dir = bbspath'Horses'
  105.  
  106.   if ~exists(dir) then makedir(dir)
  107.  
  108. /*Program variable initialization */
  109.  
  110.   Uhandle = name                        /* get the user's handle           */
  111.   Udate = date()            /* get current date & time         */
  112.   CLS = 'H'
  113.   Hname.1 = "Tumble Weed"
  114.   Hname.2 = "Frisky Girl"
  115.   Hname.3 = "Citation"
  116.   Hname.4 = "Thunder"
  117.   Hname.5 = "Whirlaway"
  118.   Hname.6 = "Seabiscuit"
  119.   Hname.7 = "Comet"
  120.   Hname.8 = "Old-Nag"
  121.  
  122. /************************************************************************/
  123. /*                            MAIN PROGRAM                              */
  124. /************************************************************************/
  125. MAIN:
  126.   call random(1,10,time(s))
  127.   CALL PLAYERFILE
  128.   CALL CHECKBALANCE
  129.   Choice = 0
  130.   Do until Choice = 5
  131.      say CLS
  132.      say "                    ***************************"cr
  133.      say "                       Welcome to BBS Downs!"cr
  134.      say "                    ***************************"cr
  135.      say ""cr
  136.      say "                       1) Read Instructions"cr
  137.      say "                       2) View Scoreboard"cr
  138.      say "                       3) Millionaires Club" cr
  139.      say "                       4) Go to the Track!"cr
  140.      say "                       5) Quit"cr
  141.      say ""cr
  142.      say "                    ***************************"cr
  143.      say ""cr
  144.      Options prompt"                    What would you like to do?  "
  145.      pull Choice
  146.      CALL checkBBS()
  147.      If Choice = 1 then CALL INSTRUCT
  148.      else If Choice = 2 then CALL SCOREBOARD
  149.      else If Choice = 3 then CALL MILLIONS
  150.      else If Choice = 4 then CALL THETRACK
  151.   end
  152.   CALL BYE
  153. EXIT
  154.  
  155. PLAYERFILE:
  156.   say CLS
  157.   say "Checking player file..."cr
  158.   say ""cr
  159.   AcctBal = 100
  160.   Flag = 0
  161.   nplayers = 0
  162.  
  163.   if ~exists(dir'/Dplayers') then do     /* Create a Players file if needed*/
  164.     call open(file1,dir'/Dplayers', 'W')
  165.     call writeln(file1,'0')              /* There are no players as yet */
  166.     call close(file1)
  167.    end
  168.  
  169.    call open(file1,dir'/Dplayers', 'R')      /* Read in existing player info */
  170.      nplayers = readln(file1)        /* Get current number of players */
  171.       if nplayers = 0 then signal newfile
  172.      do i = 1 to nplayers
  173.         player.i = readln(file1)     /*Read a player's name*/
  174.         score.i = readln(file1)      /*Read a player's score*/
  175.         if player.i = Uhandle then do  /*find user's acct balance*/
  176.        AcctBal = score.i           /*set user's acct balance*/
  177.            say "I see you have bet here before!"cr
  178.            say "Your account balance is:  $"AcctBal""cr
  179.            Flag = 1                   /*signal player was found*/
  180.         end
  181.      end
  182.    call close(file1)
  183. Newfile:
  184.    if Flag = 0 then do                 /*if player was not found in file*/
  185.        if nplayers < MaxPlayers then do 
  186.          say "A new player!!"cr
  187.          say "You will be given $100 to start you out!"cr
  188.          nplayers = nplayers + 1
  189.          player.nplayers = UHandle
  190.          score.nplayers = AcctBal
  191.          call close(file1)
  192.          end
  193.        else if nplayers >= MaxPlayers then do
  194.          say ""cr
  195.          say "Sorry there is no room for another gambler at the track!"cr
  196.          say "Talk to "SysopName" maybe he/she can do something about that!"cr
  197.          CALL BYE
  198.        end
  199.     end
  200.   CALL PAUSE
  201. RETURN
  202.  
  203. CHECKBALANCE:
  204.   LowBal = "FALSE"
  205.   If AcctBal <= 2 then do
  206.     LowBal = "TRUE"
  207.     say ""cr
  208.  
  209.     say "It seems your account balance of $"AcctBal" is too low to place any bets."cr
  210.     say ""cr
  211.     Options prompt"Would you like to try to win $50 with no strings attached? "
  212.     pull Flag ; Flag = upper(Flag) ; flag = left(flag,1)
  213.     say ""cr
  214.     If Flag = "Y" then do
  215.       say ""cr
  216.       Options prompt"Okay, Pick a number between 1 and 5:  "cr
  217.       pull Guess
  218.       RNum = RANDOM(1,5)
  219.       if Guess = RNum then do
  220.          say ""cr
  221.          say "You guessed it!!! Adding to your Account Balance..."cr
  222.          say ""cr
  223.          AcctBal = AcctBal + 50
  224.          LowBal = "FALSE"
  225.          end
  226.       else do
  227.          say ""cr
  228.          say "Sorry the number was "RNum".  Try again sometime!"cr
  229.          say ""cr
  230.          end
  231.     end
  232.     else do
  233.       say ""cr
  234.       say "Okay fine...but you won't be able to place any bets until "cr
  235.       say "you have more money!!"cr
  236.       say ""cr
  237.       end
  238.     CALL PAUSE
  239. end
  240. RETURN
  241.  
  242. INSTRUCT:
  243.   say CLS
  244.  
  245.   say'  This is a horse racing game rewritten for DLG by Basil Barnes from a'cr
  246.   say'CNET game.'cr
  247.   say cr
  248.   say'  The game is pretty well self-explanatory.  Play it for a while and'cr
  249.   say'see how addictive it is.'cr
  250.   say cr
  251.   say'  Please note:  You MUST have an ansi positioning terminal program to be'cr
  252.   say'able to play this game.'cr
  253.   say cr
  254.   say'                                         Basil Barnes'cr
  255.   say'                                         August 6, 1992'cr
  256.   say cr
  257.   say'This version has been adapted to run on BBBBS by Matt English. 1-12-93'cr
  258.   say ""cr
  259.   CALL PAUSE
  260. RETURN
  261.  
  262. SCOREBOARD:
  263.   say ""CLS" Sorting Scores............."cr
  264.   CALL SORTSCORES
  265.   Flag = 1
  266.   i = 1
  267.   j = 1
  268.   More = 'Y'
  269.   Do Forever
  270.      if More ~= 'Y' then break
  271.      Do while Flag = 1
  272.         say CLS
  273.         say "                    *******************************"cr
  274.         say "                              SCOREBOARD"cr
  275.         say "                    *******************************"cr
  276.         Flag = 0
  277.      end
  278.      if player.j = UHandle then Score.j = AcctBal
  279.      P = Left(Player.j,20,' ')   /*Pad end of handle with spaces*/
  280.      say "                       "P"  $"Score.j""cr
  281.      i = i + 1
  282.      j = j + 1
  283.      if j > Nplayers then break
  284.      else if j <= Nplayers & i = 11 then do
  285.          Flag = 1
  286.          i = 0          /* Only display 10 names per page */
  287.          say "                    *******************************"cr
  288.          Options prompt"                    Do you want to see more(Y/N)? "cr
  289.          pull More ; more = upper(more) ; more = left(more,1)
  290.          iterate
  291.        end
  292.      else if j <= Nplayers & i < 11 then iterate
  293.   end
  294.   if More = 'Y' then say "                    *******************************"cr
  295.   CALL PAUSE
  296. RETURN
  297.  
  298. MILLIONS:
  299.   say CLS
  300.   say ""cr
  301.   if exists(dir'/Dmillions') then do
  302.     call open(mill,dir'/Dmillions', 'R')
  303.         j = 0
  304.         i = 0
  305.         do while ~eof(mill)
  306.         do while j = 0
  307.           say CLS
  308.           say "             ***********************************************"cr
  309.           say "                            MILLIONAIRES CLUB"cr
  310.           say "             ***********************************************"cr
  311.           j = 1
  312.         end
  313.           line = readln(mill)
  314.           say "             "line""cr
  315.           i = i + 1
  316.           if i = 10 then do
  317.             j = 0
  318.             i = 0
  319.             call PAUSE
  320.           end
  321.         end
  322.     call close(mill)
  323.   end
  324.   else do
  325.     say "There are no millionaires yet..."cr
  326.   end
  327.   say ""cr
  328.   CALL PAUSE
  329. RETURN
  330.  
  331. CHECKMILLIONS:
  332.   if acctbal >= 1000000 then do
  333.     say ""cr
  334.     say "Congratulations!!!! You have become a Millionaire!!"cr
  335.     say "Adding your name to this elite group of gamblers...."cr
  336.     say cr
  337.     say 'The game is now being reset!...'cr
  338.     call delay(100)
  339.  
  340.     call delete(dir'/Dplayers')
  341.     Nplayers = 1
  342.     Player.1 = UHandle
  343.  
  344.     say ""cr
  345.     line = left(UHandle,22,' ')||"$"AcctBal||"  "||left(UDate,15)
  346.     if ~exists(dir'/Dmillions') then do     /* Create a Dmillions file if needed*/
  347.       call open(fileM,dir'/Dmillions', 'W')
  348.       call writeln(fileM, line)  /* Put player in file */
  349.       call close(fileM)
  350.     end
  351.     else do
  352.       call open(fileM,dir'/Dmillions', 'A')
  353.       call writeln(fileM,line)   /* Add player to file */
  354.       call close(fileM)
  355.     end
  356.     AcctBal = 1000
  357.     say "Your new account balance is $1,000."cr
  358.     say ""cr
  359.     options prompt"Would you like to see the Millionaires Club list (Y/N)? "
  360.     pull More ; more = upper(more) ; more = left(more,1)
  361.     If More = "Y" then CALL MILLIONS
  362.   end
  363. RETURN
  364.  
  365. SORTSCORES:
  366.   /* Straight Selection Sort */
  367.   do i = 1 to (Nplayers - 1)
  368.      do j = (i+1) to Nplayers
  369.         if Score.i < Score.j then do
  370.           Temp = Score.i
  371.           Score.i = Score.j
  372.           Score.j = Temp
  373.           Temp = Player.i
  374.           Player.i = Player.j
  375.           Player.j = Temp
  376.         end
  377.      end
  378.   end
  379. RETURN
  380.  
  381. THETRACK:
  382.   Another = "Y"
  383.   Do While Another = "Y"
  384.        CALL checkBBS()
  385.        CALL CHECKBALANCE
  386.     If LowBal = "FALSE" then do
  387.        CALL BOOKIE
  388.        CALL GETBETS
  389.        CALL RACE
  390.        CALL WINNERS
  391.        say ""cr
  392.        options prompt"Do you want to play another race?  "
  393.        pull Another ; Another = upper(Another) ; Another = left(another,1)
  394.      end
  395.      else Another = "N"
  396.   end
  397. RETURN
  398.  
  399. BOOKIE:
  400.   /* Choose the odds on the horses */
  401.   do i = 1 to 8
  402.     WOdds.i = random(1,15)    /* Pick a random number*/
  403.     POdds.i = Left(WOdds.i *.75,pos('.', WOdds.i*.75) -1)
  404.     SOdds.i = Left(WOdds.i *.5,pos('.', WOdds.i*.5) -1)
  405.   end
  406.  
  407.   /* Set all bets to zero */
  408.   do i = 1 to 3
  409.     WHorse.i = 0
  410.     WBet.i = 0
  411.   end
  412.  
  413.   say CLS
  414.   say "*********************************************************************"cr
  415.   say "                         PLACE YOUR BETS!!"cr
  416.   say "*********************************************************************"cr
  417.   say "  No.         Horse           Win Odds     Place Odds     Show Odds"cr
  418.   say "  ---    ---------------      --------     ----------     ---------"cr
  419.   do i = 1 to 8
  420.     tes1 = right(Hname.i,16,' ')
  421.     tes2 = right(WOdds.i,14,' ') 
  422.     tes3 = right(POdds.i,12,' ')
  423.     hnum = right(i,4,' ')
  424.     todd = right(SOdds.i,12,' ')
  425.  
  426.     say''hnum''tes1''tes2':1'tes3':1'todd':1'cr
  427.     
  428.     /*call writech(stdout,right(i,4,' ')                   /* Horse No.    */
  429.     call writech(stdout,tes1)                             /* Horse's name */
  430.     call writech(stdout,tes2":1")                         /* Win Odds     */
  431.     call writech(stdout,tes3":1")                         /* Place Odds   */
  432.     say right(SOdds.i,12,' ')":1"         /* Show Odds    */    */
  433.   end
  434.   say "*********************************************************************"cr
  435.   say ""cr
  436. RETURN
  437.  
  438. GETBETS:
  439.   str.1 = "WIN:  "
  440.   str.2 = "PLACE:  "
  441.   str.3 = "  SHOW:  "
  442.   i = 1
  443.   do forever
  444.     /* Position cursor for each bet */
  445.     say "HBB      "
  446.     ab = Left(AcctBal,10,'.')
  447.     say "Your account balance is:  $"AB""cr
  448.     say "        "cr
  449.     do j = 1 to 4
  450.       say "                                                                      "cr
  451.     end
  452.     call writech(stdout,"A")
  453.  
  454.     if i > 3 then break       /* Check for all bets in*/
  455.  
  456.     if AcctBal < 2 then break  /* Not enough money to bet anymore */
  457.  
  458.     /* Get the horse number to bet on for each: win, place, show */
  459.     options prompt"Enter the horse number to " str.i" "
  460.     pull WHorse.i
  461.     say ""cr
  462.     if WHorse.i = '' then do
  463.        /* Check if user pressed return, if so there is no bet on this round */
  464.        WBet.i = 0
  465.        i = i + 1
  466.        iterate
  467.     end
  468.     else if WHorse.i < 1 | WHorse.i > 8 then do
  469.        /* Make sure horse number bet on is within range */
  470.        call writech(stdout,"B")
  471.        call writech(stdout,"Invalid Horse number.  Try again!")
  472.        iterate
  473.     end
  474.     if Whorse.i ~= ''then do
  475.        /* If a horse is being bet on then get the amount of the bet */
  476.        options prompt"How much do you want to bet:  "
  477.        pull WBet.i
  478.        if WBet.i >= 2 & WBet.i <= AcctBal & WBet.i <= 2000 then do
  479.          /* make sure the amount of the bet is within range */
  480.          AcctBal = AcctBal - WBet.i
  481.          i = i + 1
  482.          iterate
  483.        end
  484.        else if WBet.i < 2 then do
  485.          /* if bet is too low then redo */
  486.          call writech(stdout,"B")
  487.          call writech(stdout,"Sorry you must bet at least $2.  Try again!")
  488.          iterate
  489.        end
  490.        else if WBet.i > AcctBal then do
  491.          /* if bet is too high then redo */
  492.          call writech(stdout,"B")
  493.          say "You can not bet more than your account balance of:  $"AcctBal". Try Again!"cr
  494.          iterate
  495.        end
  496.        else if WBet.i > 2000 then do
  497.          /* if bet is too high then redo */
  498.          say "You can not bet more $2,000. Try Again!"cr
  499.          iterate
  500.        end
  501.      end
  502.   say ""cr
  503.   end
  504.  
  505.   if AcctBal < 2 then say "BYou have bet as much as you can.  The window is now closed!!"cr
  506.  
  507.   CALL PAUSE
  508. RETURN
  509.  
  510. RACE:
  511.   call writech(stdout,CLS"H")  /* clear screen and go to home position */
  512.   say ""cr
  513.   say "THEY'RE OFF!!!"cr
  514.   say ""cr
  515.   /* The race itself is 55 spaces long */
  516.   say "++++++++++++|Start------------------------------------------Finish|" cr
  517.   do i = 1 to 8
  518.     say RIGHT(Hname.i, 12,' ')"|"cr
  519.     Count.i = 1    /* reset all horse counters */
  520.   end
  521.   say "++++++++++++|-----------------------------------------------------|" cr
  522.   call writech(stdout,"")
  523.   win = 0    /* no winning horse yet */
  524.   place = 0  /* no place horse yet */
  525.   show = 0   /* no show horse yet */
  526.  
  527.   j = random(1,8)  /* pick random horse to start out of gate */
  528.   Flag = "Go"
  529.   Do while Flag = "Go"
  530.     i = j
  531.     j = 1  /* always start at 1 after 1st time through loop */
  532.     do while i <= 8     /* cycle through each horse and add up their 'scores' */
  533.       RNum = random(1,5)    /* Pick a random number*/
  534.       Count.i = Count.i + RNum        /* Add the number to the current horse's count */
  535.       /* Draw the horse's new position if he has not already crossed finish line*/
  536.       If (i ~= Win) & (i ~= Place) & (i ~= Show) then do
  537.         call writech(stdout,"HCCB") /* Position cursor at top of Race Track */
  538.         call writech(stdout,""i"B")        /* move down to the current horse's vertical positon */
  539.         /*Draw current horse's horizontal position */
  540.         call writech(stdout,Copies(' ', (Count.i) - 2) i)
  541.       end
  542.  
  543.       /* Check for win, place, and show horse */
  544.       If Count.i >= 55 then do
  545.          If Win = 0 then do         
  546.             Win = i  /* remember winning horse's number */
  547.             call writech(stdout,"HCCB")
  548.             call writech(stdout,""i"B")
  549.             call writech(stdout,Copies(' ', (Count.i) - 2) "W")
  550.          end
  551.          else if (Place = 0) & (i ~= Win) then do
  552.             Place = i  /* remember place horse's number */
  553.             call writech(stdout,"HCCB")
  554.             call writech(stdout,""i"B")
  555.             call writech(stdout,Copies(' ', (Count.i) - 2) "P")
  556.          end
  557.          else if (Show = 0) & (i ~= Win) & (i ~= Place) then do
  558.             Show = i   /* remember show horse's number */
  559.             call writech(stdout,"HCCB")
  560.             call writech(stdout,""i"B")
  561.             call writech(stdout,Copies(' ', (Count.i) - 2) "S")
  562.             i = 8  /* race is over */
  563.             Flag = "Stop"  /* signal end of race */
  564.          end
  565.        end /* If Count.i >= 55 then do */
  566.  
  567.        i = i + 1
  568.     end  /* Do while i <= 8 */
  569.   end /* Do while Flag = "Go" */
  570.   call writech(stdout,"HBB")
  571.   CALL PAUSE
  572. RETURN
  573.  
  574. WINNERS:
  575.   say ""cr
  576.   say "Horse #"Win" is the winner!!"cr
  577.   If WHorse.1 = '' then  say "You did not bet on a horse to win!"cr
  578.   else do
  579.     say "You bet $"WBet.1" on Horse #"WHorse.1" to win."cr
  580.     If WHorse.1 = Win then do
  581.        Won = WBet.1 * WOdds.Win
  582.        AcctBal = AcctBal + Won  + WBet.1
  583.        say "Congratulations! You WIN $"Won" on your win bet!" cr
  584.     end
  585.     else say "Sorry you LOST on your win bet." cr
  586.   end
  587.   say ""cr
  588.  
  589.   say "Horse #"Place" placed!"cr
  590.   If WHorse.2 = '' then say "You did not bet on a horse to place!"cr
  591.   else do
  592.     say "You bet $"WBet.2" on Horse #"WHorse.2" to place." cr
  593.     If (WHorse.2 = Place) | (WHorse.2 = Win) then do
  594.        Won = WBet.2 * WOdds.Place
  595.        AcctBal = AcctBal + Won + WBet.2
  596.        say "Congratulations! You WIN $"Won" on your place bet!" cr
  597.     end
  598.     else say "Sorry you LOST on your place bet." cr
  599.   end
  600.   say ""cr
  601.  
  602.   say "Horse #"Show" showed."cr
  603.   If WHorse.3 = '' then say "You did not bet on a horse to show!"cr
  604.   else do
  605.     say "You bet $"WBet.3" on Horse #"WHorse.3" to show."cr
  606.     If (WHorse.3 = Show) | (WHorse.3 = Place) | (WHorse.3 = Win) then do
  607.        Won = WBet.3 * WOdds.Show
  608.        AcctBal = AcctBal + Won + WBet.3
  609.        say "Congratulations! You WIN $"Won" on your show bet!"cr
  610.     end
  611.     else say "Sorry you LOST on your show bet." cr
  612.   end
  613.     call pause
  614. RETURN
  615.  
  616. PAUSE:
  617.   say ""cr
  618.   options prompt "Press [Return] to continue..."
  619.   pull junk
  620.   say ""cr
  621. RETURN
  622.  
  623.  
  624. BYE:
  625.     CALL CHECKMILLIONS
  626.     say ""cr
  627.     say "                     Brought to you by Sean Kelly "cr
  628.     say ""cr
  629.     say "                       Amizon BBS  312-775-9138"cr
  630.     say "                  Ported over to DLG by Basil Barnes"cr
  631.     say "                    Amiga Devil BBS (403)-484-9200"cr
  632.     say ""cr
  633.     say "               Adapted to BBBBS by Matt English 1-11-93"cr
  634.     say "                  The Alternative BBS (503)761-3043"cr
  635.     say""cr
  636.     say "                      Returning to "BBSname"..."cr
  637.     CALL SORTSCORES
  638.     /* Rewrite PlayersFile */
  639.     call open(file1,dir'/Dplayers', 'W')
  640.     call writeln(file1,NPlayers)
  641.       do i = 1 to NPlayers
  642.         if player.i = UHandle then Score.i = AcctBal
  643.         call writeln(file1, player.i)
  644.         call writeln(file1, score.i)
  645.       end
  646.     call close(file1)
  647. EXIT
  648.  
  649. /************************************************************************/
  650. /* Error Handling Routines                                              */
  651. /************************************************************************/
  652.  
  653. syntax:
  654.     say 'Syntax Error in 'progname'.  Line:  'SIGL''cr
  655.     say 'Error:  'RC' 'errortext(RC)''cr
  656.     say 'Please notify 'sysopname'!'cr
  657.     say 'Returning to 'BBSname'...'cr
  658. EXIT
  659.  
  660.  
  661. checkBBS:
  662. IF ADDRESS()~='BAUD' THEN RETURN 0
  663. IF TIME('e')>secs THEN SIGNAL BYE
  664. dcd
  665. IF RC=0 THEN SIGNAL BYE
  666. temp=secs-TIME('E')
  667. IF temp<120 THEN SAY '*** Only' temp 'seconds left! ***'CR 
  668. RETURN 0
  669.  
  670.  
  671. BREAK_C:
  672. BREAK_E:
  673. SIGNAL bye
  674.  
  675. /* Horse_Racing.rexx */
  676.