home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
amigalibdisks
/
disk950
/
bbdoors
/
bbdoors65.lha
/
rexxDoors
/
Hollywood_Squares.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-08-07
|
21KB
|
577 lines
/*********************************************************
* *
* Hollywood Squares 2.1 (C) 1991 Barry Christiansen *
* A trivia game for SKYLINE *
* *
* This ARexx script is freely ditributable but not *
* in the Public Domain. You may use this script for *
* any purpose you see fit other than that of generating *
* a profit. *
* *
* Disclaimer: I hearby proclaim I am NOT responsible *
* accountable, ammenable, answerable or liable for any *
* damage this software may cause you and your children *
* or you children's children. *
* *
* Call THE HOST *
* (605) 697-5653 *
* *
* Rewritten for BBBBS by Richard Lee Stockton 14-Apr-91 *
* *
* ANSI ENHANCED VERSION BY Rick Lembrée *
* *
* ANSI version adapted to BBBBS by Matt English 1-13-93 *
* *
**********************************************************/
CR='0D'x
CALL TIME('R')
SIGNAL ON SYNTAX
SIGNAL ON BREAK_C
SIGNAL ON BREAK_E
PARSE ARG UserName . . colorflag secs .
IF secs='' THEN secs=3600
bbspath=GETCLIP('BBS_path')
bbsname = 'the BBS' /* The name of your BBS */
sysopname = '+ AMIGA +' /* The name the Sysop goes by */
HSData = bbspath'rexxDoors/Data/HS.Users' /* location of user data */
HSQuestions = bbspath'rexxDoors/Data/' /* location of questions file */
Qfiles= 4 /* Number of questions files available */
TotalPlays = 5 /* How many plays per day */
if ~show('L','rexxsupport.library') then do
addlib('rexxsupport.library',0,-30,0)
end
if colorflag = 1 then do
say' Colors on!'cr
RED = '
'; GRN = '
'; YEL = '
'; BLU = '
'; MAG = '
'; CYA = '
'; BLK = '
'; BAK = '
'; OFF = '
' ; BSLF = 'DB'
P7='H3H';P8='9H';P9='5H';P4='3H';P5='9H';P6='5H';P1='33H';P2='39H';P3='45H'
CLS = 'H';bak1 = '
'
P11='1H';P12='H';CLEOL=''
BIGX = ''YEL' 'BSLF' X 'BSLF' '; BIGO = ''MAG' 'BSLF' O 'BSLF' '
end
else do
RED = ''; GRN = ''; YEL = ''; BLU = ''; MAG = ''; CYA = ''; BAK = ''; BLK = ''; OFF = ''; CLS = CR''CR
P11 = CR; P12 = CR;CLEOL='';bak1= ''
BIGX = ' X '; BIGO = ' O '
end
UserName2 = center(UserName,26)
UserWins = 0; OtherWins = 0; UserLoses = 0; OtherLoses = 0
RePlay = 0; i = random(1,999,time('S')) /* initalize random number generator */
call Intro
CALL delay(100)
OPTIONS PROMPT CR' Do You Need Instructions (Y/N)? '
call Hotkey
if answer = 'Y' then call Instructions
OPTIONS PROMPT CR' Do You Want To See Hollywood Squares User Stats (Y/N)? '
call Hotkey
if answer = 'Y' then call ShowList
/* Main program body follows */
MAIN:
say''cls''cr
CALL TRANSMIT CR''GRN'Getting questions ready, Hold on...'
filenum = random(1,Qfiles)
address command 'copy 'hsquestions||'Questions'||filenum' RAM:Questions'
CALL OPEN('Qdata','Ram:Questions','R')
i = 0
do until eof('Qdata')
do j = 1 to 6
line = readln('Qdata')
end
i = i+1
end
CALL CLOSE('Qdata')
TQuestions = i-1
over = 0
call OpenThings
do i = 1 to 9
SQ.i = ''
end
call Refresh
do forever
CALL checkBBS()
/* select a square and check if valid */
validsquare = 0
do while validsquare = 0
squarec = ''
do while squarec < '1' | answer > '9'
say''P12' '
OPTIONS PROMPT ''BLU''P12' Select A Square: 'GRN
call Hotkey; squarec = answer
if squarec = 'R' then call Refresh
end
squaren = value(squarec)
if SQ.squaren = '' then validsquare = 1
if validsquare = 0 then do
CALL TRANSMIT ''RED'Invalid square! '
CALL delay(50)
end
end
/* Select a random question */
CALL TRANSMIT YEL''P11'Loading question.....'
RanQ = RANDOM(1,TQuestions)
CALL OPEN('Qdata','Ram:Questions','R')
Qcount = 1
do until eof('Qdata')
if RanQ = Qcount then do
Question = readln('Qdata')
do i = 1 to 4
answer.i = readln('Qdata')
end
line = readln('Qdata')
leave
end
else do i = 1 to 6
line = readln('Qdata')
end
Qcount = Qcount + 1
end
CALL CLOSE('Qdata')
/* Display the Question and randomize the answers */
CALL TRANSMIT ''P11''Question''OFF''
firsttime = 0
do i = 4 to 1 by -1
j = random(1,i)
Pick.i = answer.j
if j = 1 & firsttime = 0 then do
CorrectAnswer = i
firsttime = 1
end
if j < i then do x = j to i-1
xx = x + 1
answer.x = answer.xx
end
end
CALL TRANSMIT ' '
do i = 1 to 4
CALL TRANSMIT ''BLU'['i'] - 'Pick.i
end
Guess = '';rfrsh = 0
do while Guess < '1' | Guess > '4'
say''P12' '
OPTIONS PROMPT YEL''P12'Enter Your Guess: 'BLU
call Hotkey
Guess = answer
if Guess = 'R' then do
call Refresh
CALL TRANSMIT CYA''P11''Question
CALL TRANSMIT ' '
do i = 1 to 4
CALL TRANSMIT YEL'['i'] - 'BLU''Pick.i
end
end
end
XO = BIGO; who = MAG'O'
SQ.squaren = XO
whostring = P11''GRN'Correct! 'who''BLU' Gets the Square!'CLEOL
if Guess ~= CorrectAnswer then do
XO = BIGX; who = YEL'X'
SQ.squaren = XO
whostring = P11''RED'Incorrect! 'who''BLU' Gets the Square! 'CYA'The correct answer was 'YEL''CorrectAnswer''CLEOL''
call check
if win = 'yes' then do
whostring = P11''RED'Incorrect! 'GRN'The Square remains open! 'CYA'The correct answer was 'YEL''CorrectAnswer''CLEOL''
SQ.squaren = ''; XO = 'null'
end
end
CALL TRANSMIT whostring||CR
CALL delay(100)
if colorflag = 1 then do
do i = 1 to 5
CALL TRANSMIT CLEOL
end
end
call clear11
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
else call VanillaDisplay
call Check
if win = 'yes' then call won
if win = 'tie' then call tie
if Over = 1 then leave
validsquare = 0
do while validsquare = 0
rannum = RANDOM(1,9)
if SQ.rannum = '' then validsquare = 1
end
Both = BIGO
call BestBet
Both = BIGX
call BestBet
squaren = rannum
Correct = RANDOM(1,2)
if Correct = 1 then do
XO = BIGX; who = YEL'X'
whostring = P11''who''BLU' Gets the Square!'CLEOL
SQ.squaren = XO
CALL TRANSMIT P11''CYA''subword(OtherName,1,1)' Goes For #'squaren' and answers his question'GRN' CORRECTLY!'
CALL delay(100)
end
else do
XO = BIGO; who = MAG'O'
whostring = P11''who''BLU' Gets the Square!'CLEOL
SQ.squaren = XO
CALL TRANSMIT P11''CYA''subword(OtherName,1,1)' Goes For #'squaren' and answers his question'RED' INCORRECTLY!'
CALL delay(100)
call check
if win = 'yes' then do
whostring = P11''GRN'The Square remains open!'CLEOL
SQ.squaren = ''; XO = 'null'
end
end
CALL TRANSMIT whostring
CALL delay(100)
call clear11
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
else call VanillaDisplay
call Check
if win = 'yes' then call won
if win = 'tie' then call tie
if Over = 1 then leave
end
RePlay = RePlay + 1
if RePlay = TotalPlays then do
CALL TRANSMIT RED''P11'You Have Used All Your Turns For This Session!'
CALL delay(50)
signal BYE
end
OPTIONS PROMPT BLU''P11'Do You Want To Play Again (Y/N)? 'GRN
call Hotkey
if answer = 'Y' then signal MAIN:
signal BYE
Refresh:
if colorflag =