home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
amigalibdisks
/
disk950
/
bbdoors
/
bbdoors65.lha
/
rexxDoors
/
Yacht_C.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-08-07
|
32KB
|
1,254 lines
/* Yacht-C.rexx version 1.1 by Matt English 8-4-93
This game was written to work on Richard Stockton's
BBBBS program. You are welcome to use this on your
BBBBS system as long as my name is not removed from
this code, or the game screen.
CONVERSIONS : !!!!!!!!
You are given permission to convert this game to ANY
other BBS system, Amiga or IBM, as long as:
1. You leave my name in the code and on the game screen.
2. You have never written a game that says "ONLY TO BE
USED ON xxxxx BBS SYSTEM". ( I really, really hate that!)
TO ALL SYSOPS:
If you use this game, a call to my BBS would be nice!
(If you've never called.) I have more ideas for the game,
and if I get enough interest there will be a "next version".
The Alternative BBS (503) 761-3043
TO INSTALL ON BBBBS:
All ya have to do is copy the file "Yacht_C.rexx"
to your RexxDoors directory. The game will create
some data files after its played. Easy, Huh?
Enjoy.
*/
options results
FF='0C'x /* FormFeed */
CR='0D'x /* Carraige Return */
CALL TIME('R')
SIGNAL ON BREAK_C
SIGNAL ON BREAK_E
bbspath=GETCLIP('BBS_path')
bbspath=bbspath'rexxDoors/Data/'
datapath = bbspath'Yacht_C'
/* Open the support library if it is not already open. */
if ~show('L',"rexxsupport.library") then do
addlib('rexxsupport.library',0,-30,0)
end
wz = random(1,999,time('S')) /* initalize random number generator */
PARSE arg name winnings . colorflag secs .
IF secs='' THEN secs=3600
signal on syntax
player = left(name,20)
address command'C:resident C:sort add'
def=''
CLS = 'H'
UNL = '
'
call Prefs(1)
IF ADDRESS()~='BAUD' THEN call Prefs(5)
player = pen.6||unl||player||def
/* Positions */
pplayer='H';ps.1='8H';ps.2='8H';ps.3='8H';ps.4='8H';ps.5='8H'
ps.6='8H';psub='8H';pbon='28H';putot='28H';ps.3k='28H'
ps.4k='28H';ps.fh='28H';ps.ss='28H';ps.ls='28H'
ps.c='28H';ps.y='28H';pltot='28H';putot2='28H';ptot='28H'
pln.1='H';pln.2='H';pln.3='H';pln.4='H';pln.5='H';pln.6='H';pln.3k='1H'
pln.4k='1H';pln.fh='1H';pln.ss='1H';pln.ls='1H'
pln.c='1H';pln.y='1H'
phold.1='5H';phold.2='1H';phold.3='7H';phold.4='3H';phold.5='9H'
prollsleft='38H'
pprompt='34H'
pprompt1='34H'
pprompt2='34H'
pd.1.1='5H';pd.1.2='6H';pd.1.3='7H';pd.1.4='5H';pd.1.5='6H';pd.1.6='7H';pd.1.7='5H';pd.1.8='6H';pd.1.9='7H'
pd.2.1='1H';pd.2.2='2H';pd.2.3='3H';pd.2.4='1H';pd.2.5='2H';pd.2.6='3H';pd.2.7='1H';pd.2.8='2H';pd.2.9='3H'
pd.3.1='7H';pd.3.2='8H';pd.3.3='9H';pd.3.4='7H';pd.3.5='8H';pd.3.6='9H';pd.3.7='7H';pd.3.8='8H';pd.3.9='9H'
pd.4.1='3H';pd.4.2='4H';pd.4.3='5H';pd.4.4='3H';pd.4.5='4H';pd.4.6='5H';pd.4.7='3H';pd.4.8='4H';pd.4.9='5H'
pd.5.1='9H';pd.5.2='0H';pd.5.3='1H';pd.5.4='9H';pd.5.5='0H';pd.5.6='1H';pd.5.7='9H';pd.5.8='0H';pd.5.9='1H'
poptln='34H'
optstr = 'H Q P SC 1 2 3 4 5 6 3K 4K FH SS LS C Y'
sstr = '1 2 3 4 5 6 3K 4K FH SS LS C Y' /* Scoreable string */
call setlines
if ~exists(datapath) then do
call makedir(datapath)
tempname = name
name = 'MATT_ENGLISH' /* Has to be one file to match Scorelist */
call zerovar
call savedata
name = tempname
end
if exists(datapath'/'name) then call loaddata
else do
call zerovar
say''CLS''cr
say cr
say cr
say' A NEW PLAYER !!! 'cr
say' Welcome to Yacht_C !!!'cr
call delay(100)
newplayer = 1 /* first time player */
end
call refresh1
call refresh2
call setlines
/*
Loop:
do forever
spotsleft = spotsleft - 1
if spotsleft = 0 then call done
call getopt
end */
call getopt
zerovar: /* Variable values at startup */
s.1 = '' /* Score for the 1's */
s.2 = '';s.3='';s.4='';s.5='';s.6=''
sub='0';bon='0';utot='0';utot2='0'
s.3k='';s.4k='';s.fh='';s.ss='';s.ls='';s.c='';s.y='';ltot='0';tot='0'
hold.1=' ';hold.2=' ';hold.3=' ';hold.4=' ';hold.5=' '
rollsleft='3'
spotsleft = 13
dvalue.1 = 1;dvalue.2=2;dvalue.3=3;dvalue.4=4;dvalue.5=5
do t = 1 to 6
x.t = random(1,10)
end
dcstring = x.1' d1 'x.2' d2 'x.3' d3 'x.4' d4 'x.5' d5 'x.6' d6'
rvalue = 0
newplayer = 0
return
setlines:
low = bak.0||pen.1
hi = bak.2||pen.1
ln.1=''pen.1' [ 1] ones (add 1''s)'def''
ln.2=''pen.1' [ 2] twos (add 2''s)'def''
ln.3=''pen.1' [ 3] threes (add 3''s)'def''
ln.4=''pen.1' [ 4] fours (add 4''s)'def''
ln.5=''pen.1' [ 5] fives (add 5''s)'def''
ln.6=''pen.1' [ 6] 'unl'sixes (add 6''s)'def''
ln.3k=''pen.1' [3K] 3 of a kind (total)'def''
ln.4k=''pen.1' [4K] 4 of a kind (total)'def''
ln.fh=''pen.1' [FH] Full House (25)'def''
ln.ss=''pen.1' [SS] Small Straight (30)'def''
ln.ls=''pen.1' [LS] Large Straight (40)'def''
ln.c=''pen.1' [ C] Chance (total)'def''
if s.y = '' then ln.y=''pen.1' [ Y] 'unl'Yacht-C (50)'def''unl''pen.1' | 'def''
if s.y = '50' then ln.y=''pen.1' [ Y] 'unl'Yacht-C (50)'def''unl''pen.1' |'def''unl' 50'def''
if s.y = ' --' then ln.y=''pen.1' [ Y] 'unl'Yacht-C (50)'def''unl''pen.1' |'def''unl' --'def''
return
Loaddata:
call open(data,datapath'/'name,'R')
lastplay = readln(data)
colorset = readln(data)
if colorset = '' then
DO
IF ADDRESS()='BAUD' THEN colorset=1
ELSE colorset=5
END
call prefs(colorset)
say''CLS''cr
say cr
say cr
say' Welcome back to Yacht_C!!'cr
say' You last played this game on 'lastplay''cr
say cr
call delay(100)
options prompt''pen.4' Would you like to continue your last game? (Y,n) > '
pull continue
if continue = 'N' then do
call close(data)
call zerovar
return
end
call zerovar
say cr
say' Loading data, stand by ...'cr
again = 1
rollsleft = readln(data)
spotsleft = readln(data)
if spotsleft = 0 then do
call zerovar
call close(data)
return
end
do i = 1 to words(sstr)
j = word(sstr,i)
s.j = readln(data)
end
sub = readln(data)
bon = readln(data)
utot = Readln(data)
utot2 = readln(data)
ltot = Readln(data)
tot = readln(data)
do i = 1 to 5
dvalue.i = readln(data)
end
call close(data)
call refresh1
call refresh2
call setlines
call showdice
call getopt
savedata:
if exists(datapath'/'name) then call delete(datapath'/'name)
call open(data,datapath'/'name,'W')
thedate = date()
call writeln(data,thedate)
if colorset = '' then colorset = 1
call writeln(data,colorset)
call writeln(data,rollsleft)
call writeln(data,spotsleft)
do i = 1 to words(sstr)
j = word(sstr,i)
call writeln(data,s.j)
end
call writeln(data,sub)
call writeln(data,bon)
call writeln(data,utot)
call writeln(data,utot2)
call writeln(data,ltot)
call writeln(data,tot)
do i = 1 to 5
call writeln(data,dvalue.i)
end
call close(data)
return
clrl:
arg what
if what = 0 then where = pprompt
if what = 1 then where = pprompt1
if what = 2 then where = poptln
if what = 3 then where = pprompt2
if what = 2 then color = bak.6
else color = def
say''where''color' 'def' '
return
getopt:
if spotsleft = 0 then call done
call setopt
say''prollsleft''rollsleft''
call clrl(0)
call clrl(1)
do s = 1 to 5
hold.s = ' '
say''phold.s''hold.s''
end
if rollsleft = 3 then line = 'Hit 'pen.3'Return'def' 'pen.1'to Roll the dice'def' > '
if rollsleft = 2 | rollsleft = 1 then line = ' 'pen.1'Enter the Option to take or 'def''
if rollsleft = 0 then line = ''pen.1'Enter your Option'def' > '
if rollsleft = 2 | rollsleft = 1 then do
say''pprompt''line''
options prompt''pprompt1' 'pen.3'Return'def' 'pen.1'to Roll 'def'> '
end
else options prompt''pprompt''line''
pull opt
opt = upper(strip(opt))
if rollsleft = 3 then do
select
when opt = H then call help
when opt = Q then call quit(1)
when opt = SC then call checkopt
when opt = P then do
call setPrefs
call getopt
end
otherwise ca