home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d09xx / d0950.lha / BBDoors / BBDoors65.lha / rexxDoors / Hollywood_Squares.rexx < prev    next >
OS/2 REXX Batch file  |  1993-08-07  |  21KB  |  577 lines

  1. /*********************************************************
  2. *                                                         *
  3. *    Hollywood Squares 2.1 (C) 1991 Barry Christiansen    *
  4. *                A trivia game for SKYLINE                *
  5. *                                                         *
  6. *    This ARexx script is freely ditributable but not     *
  7. *   in the Public Domain.  You may use this script for    *
  8. *  any purpose you see fit other than that of generating  *
  9. *                        a profit.                        *
  10. *                                                         *
  11. *   Disclaimer: I hearby proclaim I am NOT responsible    *
  12. *  accountable, ammenable, answerable or liable for any   *
  13. *  damage this software may cause you and your children   *
  14. *              or you children's children.                *
  15. *                                                         *
  16. *                      Call THE HOST                      *
  17. *                     (605) 697-5653                      *
  18. *                                                         *
  19. *  Rewritten for BBBBS by Richard Lee Stockton 14-Apr-91  *
  20. *                                                         *
  21. *          ANSI ENHANCED VERSION BY Rick LembrΘe          *
  22. *                                                         *
  23. *  ANSI version adapted to BBBBS by Matt English 1-13-93  *
  24. *                                                         *
  25. **********************************************************/
  26.  
  27. CR='0D'x
  28. CALL TIME('R')
  29. SIGNAL ON SYNTAX
  30. SIGNAL ON BREAK_C
  31. SIGNAL ON BREAK_E
  32.  
  33. PARSE ARG UserName . . colorflag secs .
  34. IF secs='' THEN secs=3600
  35. bbspath=GETCLIP('BBS_path')
  36.  
  37. bbsname =     'the BBS'                   /* The name of your BBS                */
  38. sysopname =   '+ AMIGA +'                 /* The name the Sysop goes by          */
  39. HSData = bbspath'rexxDoors/Data/HS.Users' /* location of user data               */
  40. HSQuestions = bbspath'rexxDoors/Data/'    /* location of questions file          */
  41. Qfiles=       4                           /* Number of questions files available */
  42. TotalPlays =  5                           /* How many plays per day              */
  43.  
  44.  
  45. if ~show('L','rexxsupport.library') then do
  46.   addlib('rexxsupport.library',0,-30,0)
  47. end
  48.  
  49. if colorflag = 1 then do
  50.  
  51. say' Colors on!'cr
  52.  
  53.   RED = '';  GRN = '';  YEL = '';  BLU = '';  MAG = '';  CYA = '';  BLK = '';  BAK = '';  OFF = '' ;  BSLF = 'DB'
  54.   P7='H3H';P8='9H';P9='5H';P4='3H';P5='9H';P6='5H';P1='33H';P2='39H';P3='45H'
  55.   CLS = 'H';bak1 = ''
  56.   P11='1H';P12='H';CLEOL=''
  57.   BIGX = ''YEL'   'BSLF' X 'BSLF'   '; BIGO = ''MAG'   'BSLF' O 'BSLF'   '
  58. end
  59. else do
  60.   RED = '';  GRN = '';  YEL = '';  BLU = '';  MAG = '';  CYA = '';  BAK = '';  BLK = '';  OFF = '';  CLS = CR''CR
  61.   P11 = CR; P12 = CR;CLEOL='';bak1= ''
  62.   BIGX = '    X    '; BIGO = '    O    '
  63. end
  64.  
  65. UserName2 = center(UserName,26) 
  66. UserWins = 0; OtherWins = 0; UserLoses = 0; OtherLoses = 0
  67. RePlay = 0; i = random(1,999,time('S')) /* initalize random number generator */
  68. call Intro
  69. CALL delay(100)
  70. OPTIONS PROMPT CR'                        Do You Need Instructions (Y/N)? '
  71. call Hotkey
  72. if answer = 'Y'  then call Instructions
  73. OPTIONS PROMPT CR'            Do You Want To See Hollywood Squares User Stats (Y/N)? '
  74. call Hotkey
  75. if answer = 'Y' then call ShowList
  76.  
  77.   
  78.   /* Main program body follows */
  79.   
  80. MAIN:
  81. say''cls''cr
  82. CALL TRANSMIT CR''GRN'Getting questions ready, Hold on...'
  83. filenum = random(1,Qfiles)
  84. address command 'copy 'hsquestions||'Questions'||filenum' RAM:Questions'
  85. CALL OPEN('Qdata','Ram:Questions','R')
  86. i = 0
  87. do until eof('Qdata')
  88.   do j = 1 to 6
  89.     line = readln('Qdata')
  90.   end
  91.   i = i+1
  92. end
  93. CALL CLOSE('Qdata')
  94. TQuestions = i-1
  95. over = 0
  96. call OpenThings
  97. do i = 1 to 9
  98.   SQ.i = ''
  99. end
  100. call Refresh
  101. do forever
  102.   CALL checkBBS()
  103.   /* select a square and check if valid */
  104.   
  105.   validsquare = 0
  106.   do while validsquare = 0
  107.     squarec = '' 
  108.     do while squarec < '1' | answer > '9'
  109.  
  110.       say''P12'                    '
  111.  
  112.       OPTIONS PROMPT ''BLU''P12' Select A Square: 'GRN
  113.  
  114.       call Hotkey; squarec = answer
  115.       if squarec = 'R' then call Refresh
  116.     end
  117.     squaren = value(squarec)
  118.     if SQ.squaren = '' then validsquare = 1
  119.     if validsquare = 0 then do
  120.       CALL TRANSMIT ''RED'Invalid square!               '
  121.       CALL delay(50)
  122.     end
  123.   end
  124.  
  125.   /* Select a random question */
  126.   
  127.   CALL TRANSMIT YEL''P11'Loading question.....'
  128.   RanQ = RANDOM(1,TQuestions)
  129.   CALL OPEN('Qdata','Ram:Questions','R')
  130.   Qcount = 1
  131.   do until eof('Qdata')
  132.     if RanQ = Qcount then do
  133.       Question = readln('Qdata')
  134.       do i = 1 to 4
  135.         answer.i = readln('Qdata')
  136.       end
  137.       line = readln('Qdata')
  138.       leave
  139.     end
  140.     else do i = 1 to 6
  141.       line = readln('Qdata')
  142.     end
  143.   Qcount = Qcount + 1
  144.   end
  145.   CALL CLOSE('Qdata')
  146.   
  147.   /* Display the Question and randomize the answers */
  148.   
  149.   CALL TRANSMIT ''P11''Question''OFF''
  150.   firsttime = 0
  151.   do i = 4 to 1 by -1
  152.     j = random(1,i)
  153.     Pick.i = answer.j
  154.     if j = 1 & firsttime = 0 then do
  155.       CorrectAnswer = i
  156.       firsttime = 1
  157.     end
  158.     if j < i then do x = j to i-1
  159.       xx = x + 1
  160.       answer.x = answer.xx
  161.     end
  162.   end
  163.   CALL TRANSMIT ' '
  164.   do i = 1 to 4
  165.     CALL TRANSMIT ''BLU'['i'] - 'Pick.i
  166.   end
  167.   Guess = '';rfrsh = 0
  168.   do while Guess < '1' | Guess > '4'
  169.     say''P12'                    '
  170.     OPTIONS PROMPT YEL''P12'Enter Your Guess: 'BLU
  171.     call Hotkey
  172.     Guess = answer
  173.     if Guess = 'R' then do
  174.       call Refresh
  175.       CALL TRANSMIT CYA''P11''Question
  176.       CALL TRANSMIT ' '
  177.       do i = 1 to 4
  178.         CALL TRANSMIT YEL'['i'] - 'BLU''Pick.i
  179.       end
  180.     end
  181.   end
  182.   XO = BIGO; who = MAG'O'
  183.   SQ.squaren = XO
  184.   whostring = P11''GRN'Correct!  'who''BLU'  Gets the Square!'CLEOL
  185.   if Guess ~= CorrectAnswer then do
  186.     XO = BIGX; who = YEL'X'
  187.     SQ.squaren = XO
  188.     whostring = P11''RED'Incorrect!  'who''BLU'  Gets the Square!   'CYA'The correct answer was 'YEL''CorrectAnswer''CLEOL''
  189.     call check
  190.     if win = 'yes' then do
  191.       whostring = P11''RED'Incorrect!  'GRN'The Square remains open!  'CYA'The correct answer was 'YEL''CorrectAnswer''CLEOL''
  192.       SQ.squaren = ''; XO = 'null'
  193.     end
  194.   end
  195.   CALL TRANSMIT whostring||CR
  196.   CALL delay(100)
  197.   if colorflag = 1 then do
  198.     do i = 1 to 5
  199.       CALL TRANSMIT CLEOL
  200.     end
  201.   end
  202.   call clear11
  203.   if colorflag = 1 then CALL TRANSMIT P7''SQ.7''P8''SQ.8''P9''SQ.9''P4''SQ.4''P5''SQ.5''P6''SQ.6''P1''SQ.1''P2''SQ.2''P3''SQ.3
  204.   else call VanillaDisplay
  205.   call Check
  206.   if win = 'yes' then call won
  207.   if win = 'tie' then call tie
  208.   if Over = 1 then leave
  209.  
  210.  
  211.   validsquare = 0
  212.   do while validsquare = 0
  213.     rannum = RANDOM(1,9)
  214.     if SQ.rannum  = '' then validsquare = 1
  215.   end
  216.   Both = BIGO
  217.   call BestBet
  218.   Both = BIGX
  219.   call BestBet
  220.   squaren = rannum
  221.   Correct = RANDOM(1,2)
  222.   if Correct = 1 then do
  223.     XO = BIGX; who = YEL'X'
  224.     whostring = P11''who''BLU'  Gets the Square!'CLEOL
  225.     SQ.squaren = XO
  226.     CALL TRANSMIT P11''CYA''subword(OtherName,1,1)' Goes For #'squaren' and answers his question'GRN' CORRECTLY!'
  227.  
  228.     CALL delay(100)
  229.   end
  230.   else do
  231.     XO = BIGO; who = MAG'O'
  232.     whostring = P11''who''BLU'  Gets the Square!'CLEOL
  233.     SQ.squaren = XO
  234.     CALL TRANSMIT P11''CYA''subword(OtherName,1,1)' Goes For #'squaren' and answers his question'RED' INCORRECTLY!'
  235.     CALL delay(100)
  236.     call check
  237.     if win = 'yes' then do
  238.       whostring = P11''GRN'The Square remains open!'CLEOL
  239.       SQ.squaren = ''; XO = 'null'
  240.     end
  241.   end
  242.   CALL TRANSMIT whostring
  243.   CALL delay(100)
  244.  
  245.   call clear11
  246.   if colorflag = 1 then CALL TRANSMIT P7''SQ.7''P8''SQ.8''P9''SQ.9''P4''SQ.4''P5''SQ.5''P6''SQ.6''P1''SQ.1''P2''SQ.2''P3''SQ.3
  247.   else call VanillaDisplay
  248.   call Check
  249.   if win = 'yes' then call won
  250.   if win = 'tie' then call tie
  251.   if Over = 1 then leave
  252.  end
  253.  
  254. RePlay = RePlay + 1
  255. if RePlay = TotalPlays then do
  256.   CALL TRANSMIT RED''P11'You Have Used All Your Turns For This Session!'
  257.   CALL delay(50)
  258.   signal BYE
  259.  end
  260. OPTIONS PROMPT BLU''P11'Do You Want To Play Again (Y/N)? 'GRN
  261. call Hotkey
  262. if answer = 'Y' then signal MAIN:
  263. signal BYE
  264.  
  265. Refresh:
  266.  
  267. if colorflag = 1 then do
  268.   CALL TRANSMIT CLS
  269.   CALL TRANSMIT MAG'1H HOLLYWOOD SQUARES'
  270.   CALL TRANSMIT CYA'1H'bak1'#--7-----8-----9--#'off''
  271.   CALL TRANSMIT CYA'1H'bak1'|     |     |     |'off''
  272.   CALL TRANSMIT CYA'1H'bak1'|     |     |     |'off''
  273.   CALL TRANSMIT CYA'1H'bak1'|     |     |     |'off''
  274.   CALL TRANSMIT CYA'1H'bak1'|--4--+--5--+--6--|'off''
  275.   CALL TRANSMIT CYA'1H'bak1'|     |     |     |'off'  'GRN''UserName2
  276.   CALL TRANSMIT CYA'1H'bak1'|     |     |     |'off'             'BLU'VS'
  277.   CALL TRANSMIT CYA'31H'bak1'|     |     |     |'off'  'GRN''Othername2
  278.   CALL TRANSMIT CYA'31H'bak1'|--1--+--2--+--3--|'off''
  279.   CALL TRANSMIT CYA'31H'bak1'|     |     |     |'off''
  280.   CALL TRANSMIT CYA'31H'bak1'|     |     |     |'off''
  281.   CALL TRANSMIT CYA'31H'bak1'|     |     |     |'off''
  282.   CALL TRANSMIT CYA'31H'bak1'#-----------------#'off''
  283.   CALL TRANSMIT P7''SQ.7''P8''SQ.8''P9''SQ.9''P4''SQ.4''P5''SQ.5''P6''SQ.6''P1''SQ.1''P2''SQ.2''P3''SQ.3
  284. end
  285.  
  286. else call VanillaDisplay
  287. return
  288.  
  289. VanillaDisplay:
  290. CALL TRANSMIT ''
  291. CALL TRANSMIT '           HOLLYWOOD SQUARES'
  292. CALL TRANSMIT '          +-----+-----+-----+'
  293. CALL TRANSMIT '          | 'substr(SQ.7,1,3,' ')' | 'substr(SQ.8,1,3,' ')' | 'substr(SQ.9,1,3,' ')' |'
  294. CALL TRANSMIT '          | 'substr(SQ.7,4,3,' ')' | 'substr(SQ.8,4,3,' ')' | 'substr(SQ.9,4,3,' ')' |'
  295. CALL TRANSMIT '          | 'substr(SQ.7,7,3,' ')' | 'substr(SQ.8,7,3,' ')' | 'substr(SQ.9,7,3,' ')' |'
  296. CALL TRANSMIT '          |-----+-----+-----+'
  297. CALL TRANSMIT '          | 'substr(SQ.4,1,3,' ')' | 'substr(SQ.5,1,3,' ')' | 'substr(SQ.6,1,3,' ')' | 'UserName2
  298. CALL TRANSMIT '          | 'substr(SQ.4,4,3,' ')' | 'substr(SQ.5,4,3,' ')' | 'substr(SQ.6,4,3,' ')' |             VS'
  299. CALL TRANSMIT '          | 'substr(SQ.4,7,3,' ')' | 'substr(SQ.5,7,3,' ')' | 'substr(SQ.6,7,3,' ')' | 'OtherName2
  300. CALL TRANSMIT '          +-----+-----+-----+'
  301. CALL TRANSMIT '          | 'substr(SQ.1,1,3,' ')' | 'substr(SQ.2,1,3,' ')' | 'substr(SQ.3,1,3,' ')' |'
  302. CALL TRANSMIT '          | 'substr(SQ.1,4,3,' ')' | 'substr(SQ.2,4,3,' ')' | 'substr(SQ.3,4,3,' ')' |'
  303. CALL TRANSMIT '          | 'substr(SQ.1,7,3,' ')' | 'substr(SQ.2,7,3,' ')' | 'substr(SQ.3,7,3,' ')' |'
  304. CALL TRANSMIT '          +-----+-----+-----+'
  305. CALL TRANSMIT ''
  306. return
  307.  
  308. Clear12:
  309. if colorflag = 1 then CALL TRANSMIT P12'                              '
  310. return
  311.  
  312. Clear11:
  313. if colorflag = 1 then CALL TRANSMIT P11||CLEOL
  314. return
  315.  
  316. BestBet:
  317.   if SQ.5 = '' then rannum = 5
  318.   if SQ.7 = Both & SQ.8 = Both & SQ.9 = '' then rannum = 9
  319.   if SQ.7 = Both & SQ.9 = Both & SQ.8 = '' then rannum = 8
  320.   if SQ.8 = Both & SQ.9 = Both & SQ.7 = '' then rannum = 7
  321.   if SQ.4 = Both & SQ.5 = Both & SQ.6 = '' then rannum = 6
  322.   if SQ.4 = Both & SQ.6 = Both & SQ.5 = '' then rannum = 5
  323.   if SQ.5 = Both & SQ.6 = Both & SQ.4 = '' then rannum = 4
  324.   if SQ.1 = Both & SQ.2 = Both & SQ.3 = '' then rannum = 3
  325.   if SQ.1 = Both & SQ.3 = Both & SQ.2 = '' then rannum = 2
  326.   if SQ.2 = Both & SQ.3 = Both & SQ.1 = '' then rannum = 1
  327.   if SQ.7 = Both & SQ.4 = Both & SQ.1 = '' then rannum = 1
  328.   if SQ.7 = Both & SQ.1 = Both & SQ.4 = '' then rannum = 4
  329.   if SQ.4 = Both & SQ.1 = Both & SQ.7 = '' then rannum = 7
  330.   if SQ.8 = Both & SQ.5 = Both & SQ.2 = '' then rannum = 2
  331.   if SQ.8 = Both & SQ.2 = Both & SQ.5 = '' then rannum = 5
  332.   if SQ.5 = Both & SQ.2 = Both & SQ.8 = '' then rannum = 8
  333.   if SQ.9 = Both & SQ.6 = Both & SQ.3 = '' then rannum = 3
  334.   if SQ.9 = Both & SQ.3 = Both & SQ.6 = '' then rannum = 6
  335.   if SQ.6 = Both & SQ.3 = Both & SQ.9 = '' then rannum = 9
  336.   if SQ.7 = Both & SQ.5 = Both & SQ.3 = '' then rannum = 3
  337.   if SQ.7 = Both & SQ.3 = Both & SQ.5 = '' then rannum = 5
  338.   if SQ.5 = Both & SQ.3 = Both & SQ.7 = '' then rannum = 7
  339.   if SQ.9 = Both & SQ.5 = Both & SQ.1 = '' then rannum = 1
  340.   if SQ.9 = Both & SQ.1 = Both & SQ.5 = '' then rannum = 5
  341.   if SQ.5 = Both & SQ.1 = Both & SQ.9 = '' then rannum = 9
  342. return
  343.  
  344. Check:
  345. win = 'no'
  346. if SQ.7 = XO & SQ.8 = XO & SQ.9 = XO then win = 'yes'
  347. if SQ.4 = XO & SQ.5 = XO & SQ.6 = XO then win = 'yes'
  348. if SQ.1 = XO & SQ.2 = XO & SQ.3 = XO then win = 'yes'
  349. if SQ.7 = XO & SQ.4 = XO & SQ.1 = XO then win = 'yes'
  350. if SQ.8 = XO & SQ.5 = XO & SQ.2 = XO then win = 'yes'
  351. if SQ.9 = XO & SQ.6 = XO & SQ.3 = XO then win = 'yes'
  352. if SQ.7 = XO & SQ.5 = XO & SQ.3 = XO then win = 'yes'
  353. if SQ.9 = XO & SQ.5 = XO & SQ.1 = XO then win = 'yes'
  354. if SQ.7 ~= '' & SQ.8 ~= '' & SQ.9 ~= '' & SQ.4 ~= '' & SQ.5 ~= '' & SQ.6 ~= '' & SQ.1 ~= '' & SQ.2 ~= '' & SQ.3 ~= '' & win = 'no' then win = 'tie'
  355. return
  356.  
  357. tie:
  358. CALL TRANSMIT 'It''s A draw! Nobody wins.'
  359. CALL delay(100);
  360. CALL CLOSE('NewUserData')
  361. address command 'Delete >NIL: T:HS.Temp'
  362. Over = 1
  363. return
  364.  
  365. Won:
  366. if who = YEL'X' then do
  367.   OtherWins = OtherWins + 1
  368.   UserLoses = UserLoses + 1
  369.   CALL TRANSMIT CYA''P11''CR''CR''subword(OtherName2,1,1)''GRN' WON!'
  370.   CALL TRANSMIT CYA'This Makes A Grand Total Of 'YEL''UserLoses''CYA' Games You Have 'RED'LOST!'CR
  371. end
  372. else do
  373.   UserWins = UserWins + 1
  374.   OtherLoses = OtherLoses + 1
  375.   CALL TRANSMIT CYA''P11''CR''CR'You 'GRN' WON'CYA' this round!'
  376.   CALL TRANSMIT CYA'This Makes A Grand Total Of 'YEL''UserWins''CYA' Games You Have 'GRN'WON!'CR
  377. end
  378. call SaveIt
  379. Over = 1
  380. return
  381.  
  382. Intro:
  383. call transmit CLS
  384. call transmit GRN'                  'BLU'  ___ 'GRN'      'BLU'      'GRN'      'BLU'      'GRN'  ___ 'BLU'  ___ 'GRN'  __  '
  385. call transmit GRN'             |   |'BLU' |   |'GRN' |    'BLU' |    'GRN' \   /'BLU' |   |'GRN' |   |'BLU' |   |'GRN' |  \  '
  386. call transmit GRN'             |   |'BLU' |   |'GRN' |    'BLU' |    'GRN'  \ / 'BLU' |   |'GRN' |   |'BLU' |   |'GRN' |   | '
  387. call transmit GRN'             |---|'BLU' |   |'GRN' |    'BLU' |    'GRN'   |  'BLU' | | |'GRN' |   |'BLU' |   |'GRN' |   | '
  388. call transmit GRN'             |   |'BLU' |   |'GRN' |    'BLU' |    'GRN'   |  'BLU' |/ \|'GRN' |   |'BLU' |   |'GRN' |   | '
  389. call transmit GRN'             |   |'BLU' |___|'GRN' |____'BLU' |____'GRN'   |  'BLU' |   |'GRN' |___|'BLU' |___|'GRN' |__/  '
  390. call transmit GRN'                    ____'BLU'  ___ 'GRN'      'BLU'  ___ 'GRN'  ___ 'BLU'  ____'GRN'  ____'
  391. call transmit GRN'                   |    'BLU' |   |'GRN' |   |'BLU' |   |'GRN' |   |'BLU' |    'GRN' |    '
  392. call transmit GRN'                   |    'BLU' |   |'GRN' |   |'BLU' |   |'GRN' |   |'BLU' |    'GRN' |    '
  393. call transmit GRN'                    --- 'BLU' |   |'GRN' |   |'BLU' |---|'GRN' |--- 'BLU' |--  'GRN'  --- '
  394. call transmit GRN'                       |'BLU' |   |'GRN' |   |'BLU' |   |'GRN' |  \ 'BLU' |    'GRN'     |'
  395. call transmit GRN'                   ____|'BLU' |_\_|'GRN' |___|'BLU' |   |'GRN' |   \'BLU' |____'GRN' ____|'
  396. call transmit GRN'                        'BLU'    \'CR
  397. call transmit MAG'                                  Version 2.1                 '
  398. call transmit '                        Written by Barry Christiansen'
  399. call transmit '                    Original by  J.L. White and D.F. Duck'
  400. call delay(50)
  401. return
  402.  
  403. OpenThings:
  404. Players = 0
  405. if ~exists(HSData) then do
  406.   CALL OPEN('OldUdata',HSData,'W')
  407.   CALL CLOSE('OldUdata')
  408. end
  409. CALL OPEN('OldUdata',HSData,'R')
  410. do until eof('OldUdata')
  411.   line = readln('OldUdata')
  412.   Players = Players + 1
  413. end
  414. CALL CLOSE('OldUdata')
  415. Players = Players - 1
  416. if Players <= 1 then Players = 1
  417. WhichPlayer = Random(1,Players)
  418. x = 0
  419. CALL OPEN('OldUdata', HSData ,'R')
  420. do until eof('OldUdata')
  421.   line = readln('OldUdata')
  422.   x = x + 1
  423.   parse var line name ' : ' score
  424.   if x = WhichPlayer then OtherName = name
  425.   if OtherName = UserName then do 
  426.     line = readln('OldUdata')
  427.     parse var line name ' : ' score
  428.     OtherName = name
  429.   end
  430. end
  431. CALL CLOSE('OldUdata')
  432. if OtherName = '' then do
  433.   OtherName = sysopname
  434.   OtherName2 = center(OtherName,26,' ') 
  435. end
  436. CALL OPEN('OldUdata',HSData,'R')
  437. CALL OPEN('NewUserData','T:HS.Temp','W')
  438. do until eof('OldUdata')
  439.   line = readln('OldUdata')
  440.   parse var line name ' : ' score ' : ' score2
  441.   if name = UserName then do  
  442.     UserWins = value(score)
  443.     UserLoses = value(score2)
  444.   end
  445.   if name = OtherName then do
  446.     OtherName = name
  447.     OtherName2 = center(OtherName,26,' ') 
  448.     OtherWins = value(score)
  449.     OtherLoses = value(score2)
  450.   end
  451.   if line~='' & name ~= UserName & name ~= OtherName THEN
  452.     CALL writeln('NewUserData',line)
  453. end
  454. CALL CLOSE('OldUdata')
  455. return
  456.  
  457. ShowList:
  458. Num = 1
  459. call HEADER
  460. CALL OPEN('OldUdata',HSData,'R')
  461. TLines = 0
  462. do until eof('OldUdata')
  463.      line = readln('OldUdata')
  464.      parse var line name ' : ' score ' : ' score2
  465.      lineb = readln('OldUdata')
  466.      parse var lineb bname ' : ' bscore ' : ' bscore2
  467.      if line ~= '' then CALL TRANSMIT BAK''BLK'| o |  'left(name,20)''right(score,3)'  'right(score2,3)'      'left(bname,20)'  'right(bscore,3)'  'right(bscore2,3)'  | o |'
  468.   TLines = TLines + 1
  469.   if TLines = 10 then do
  470.     CALL TRANSMIT BAK''BLK'| o |                                                                    'BLK'| o |'
  471.     CALL TRANSMIT BAK''BLK'| o |'BLU'                      Continued on next Page...                     'BLK'| o |'
  472.     CALL TRANSMIT BAK''BLK'| o |                                                                    'BLK'| o |'OFF''
  473.     call PressReturn
  474.     Num = Num + 1
  475.     call Header 
  476.     TLines = 0
  477.     end
  478.   end
  479. CALL CLOSE('OldUdata')
  480. CALL TRANSMIT '| o |                                                                    | o |'
  481. CALL TRANSMIT '| o |                        End Of User Listing!                        | o |'
  482. CALL TRANSMIT '| o |                                                                    | o |'OFF''
  483. call PressReturn
  484. return
  485.  
  486. HEADER:
  487. call transmit CLS
  488. call transmit BAK''BLK'| o |                                                             'BLU'Page'Num'  'BLK'| o |'
  489. call transmit BAK''BLK'| o |                      'BLU'Hollywood Squares Players                     'BLK'| o |'
  490. call transmit BAK''BLK'| o |                                                                    'BLK'| o |'
  491. call transmit BAK''BLK'| o |  'MAG'Players Names       Won Lost      Players Names         Won Lost  'BLK'| o |'
  492. call transmit BAK''BLK'| o |  'MAG'------------------- --- ----      --------------------  --- ----  'BLK'| o |'
  493. return
  494.  
  495. Instructions:
  496. call transmit CLS
  497. call transmit CYA' Welcome to Hollywood Squares. This game combines Tic Tac Toe with Trivial'
  498. call transmit 'Pursuit. The object is to get three "O" in a row. This can be horizontal,'
  499. call transmit 'vertical, or diagonal. First you select which square you wish to play for.'
  500. call transmit 'A random question will then appear. If you answer correctly you get the'
  501. call transmit 'square, if not "X" gets the square. Your opponent is selected randomly from'
  502. call transmit 'among the list of players in the game. It keeps track of how many wins and'
  503. call transmit 'loses you have. The "X" player has a 50/50 chance of answering the question'
  504. call transmit 'right. If he is wrong you get the square he tries for. The "X" player is a'
  505. call transmit 'pretty good player. He knows when to block and when to go for a win.'
  506. call transmit ' '
  507. call transmit ' The squares on the board are numbered like a keypad:'BLU'  7  8  9'
  508. call transmit '                                                       4  5  6'
  509. call transmit '                                                       1  2  3'
  510. call transmit ' '
  511. call transmit CYA' At any prompt you can hit "Q" to end the game and return to the bbs.'
  512. call transmit 'If while during the game, the screen gets messed up, enter "R" to refresh'
  513. call transmit 'the screen.  If you''ve ever watched HollyWood Squares on TV, then you'
  514. call transmit 'should have no problems playing this game.'
  515. call PressReturn
  516. call transmit CLS''CR''CR
  517. return
  518.  
  519.  
  520. SaveIt:
  521.   do i = 1 to 500
  522.      end
  523.   CALL writeln('NewUserData',UserName' : 'UserWins' : 'UserLoses)
  524.   if UserName ~= OtherName then
  525.     CALL writeln('NewUserData',OtherName' : 'OtherWins' : 'OtherLoses)
  526.   CALL CLOSE('NewUserData')
  527.   if Loans > 0 then address command 'Copy T:HS.Temp to 'HSData
  528.   address command 'Delete >NIL: T:HS.Temp'
  529. return
  530.  
  531. HOTKEY:
  532. PULL answer
  533. if length(answer)>1 then signal HOTKEY: 
  534. if answer = 'Q' then signal BYE
  535. return 
  536.  
  537. PressReturn:
  538. CALL TRANSMIT ' '
  539. OPTIONS PROMPT BLU'Press 'GRN'[RETURN]'BLU' To Continue..'
  540. PULL
  541. return
  542.  
  543. TRANSMIT:
  544. PARSE ARG string
  545. SAY string||CR
  546. RETURN;
  547.  
  548. /* Procedures for handeling Errors, Logging off and/or re-entering SKYLINE */
  549.  
  550. SYNTAX:
  551.   CALL TRANSMIT 'Line:' SIGL '   Error Code:' RC
  552.   CALL TRANSMIT '*SYNTAX ERROR*  External program error.  PLEASE notify SYSOP.'
  553.   signal BYE
  554.  
  555.  
  556. checkBBS:
  557. IF ADDRESS()~='BAUD' THEN RETURN 0
  558. IF TIME('E')>secs THEN SIGNAL BYE
  559. dcd
  560. IF RC=0 THEN EXIT
  561. temp=secs-TIME('E')
  562. IF temp<120 THEN SAY '*** Only' temp 'seconds left! ***'CR 
  563. RETURN 0
  564.  
  565.  
  566. /* exit back to bbs */
  567.  
  568. BYE:
  569. BREAK_C:
  570. BREAK_E:
  571. say''cls''
  572. say' Thanks for playing!...'cr
  573. CALL TRANSMIT CR''CR'Returning to 'bbsname
  574. exit
  575.  
  576. /* Hollywood_Squares.rexx */
  577.