home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 2
/
FFMCD02.bin
/
new
/
amigalibdisks
/
disk950
/
bbdoors
/
bbdoors65.lha
/
rexxDoors
/
BlackJack.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1993-10-18
|
30KB
|
1,149 lines
/* Black Jack Version 2.0
This game is written specially to run on BBBBS, the BBS software
package written by Richard Stockton. This game was written by
Matt English on 5-7-92. You have my premission to use this game
on your BBS as long as you leave my name in the code as original writer
and you don't make any cash from this game (in any way).
This is version 1.0. I have other ideas for this game that I will put in
future versions (if I get the time). To run the game, just put this file
in your Rexxdoors directory. Hope you like it.
6-21-92
Version 2.0 now includes the ability to play from INSIDE of Chicago 1.3!
Version 2.0 wil also run fine by itself, without Chicago 1.3, but it's
more fun that way!*/
FF='0C'x /* FormFeed */
CR='0D'x /* Carraige Return */
CALL TIME('R')
SIGNAL ON BREAK_C
SIGNAL ON BREAK_E
PARSE arg Username winnings . colorflag secs .
IF secs='' THEN secs=3600
signal on syntax
if ~show('L','rexxsupport.library') then do
addlib('rexxsupport.library',0,-30,0)
end
i = random(1,999,time('S')) /* initalize random number generator */
def=''
pen2=''
pen3=''
pen4=''
pen5=''
pen6=''
pen7=''
bak2=''
bak3=''
bak4=''
bak5=''
bak6=''
bak7=''
unln=''
CLS = ''
CHICCOLOR = GetClip('CHICCOLOR')
IF colorflag=1 | CHICCOLOR = 1 THEN
DO
def=''
pen2='
'
pen3='
'
pen4='
'
pen5='
'
pen6='
'
pen7='
'
bak2='
'
bak3='
'
bak4='
'
bak5='
'
bak6='
'
bak7='
'
unln='
'
END
CLS = ''
/*This checks to see if the game has been called from Chicago 1.3
and makes the proper adjustments.*/
chicplay = GetClip('CHICMON')
if chicplay ~='' then do
avc = chicplay
chicgame = 1
secs=360 /* 6 minute limit from Chicago */
call play
end
/*-----------------MAIN SECTION----------------------*/
START:
avc = 500
say ''cls''cr
say ''cr
call header
say ''cr
call sac70'Welcome to BlackJack!'
say ''cr
call sac70'Version 2.0 6-21-92'
say ''cr
call sac70'Written by Matt English'
say ''cr
call sac70'SYSOP - The Alternative BBS - Portland Oregon'
call sac70'503-761-3043'
say ''cr
say ''cr
say ''cr
say ''cr
say ''cr
call pressreturn
say ''cr
Play:
CALL checkBBS()
cc = 0
dc = 0
h1.1='';h1.2='';h1.3='';h1.4='';h1.5='';h1.6='';h1.7='';h1.8='' /* Player hand 1 */
h2.1='';h2.2='';h2.3='';h2.4='';h2.5='';h2.6='';h2.7='';h2.8=''/* Player hand 2 */
d.1='';d.2='';d.3='';d.4='';d.5='';d.6='';d.7='';d.8='' /*Dealer hand */
say ''cr
if avc < 1 then do
call sac70'Your available funds seem to have dropped below the minimum bet!'
say ''cr
options prompt' Would you like to play again? (y,n) >'
pull answer
if answer = Y then do
avc = 500
say ''cr
call sac70'OK, let''s try it again!'
say ''cr
end
else call QUIT
end
/* options prompt ' How much would you like to bet? (Q = Quit) >'
pull choice
choice = strip(choice) */
call bet
avc = (avc - abet)
say ''cr
say ''cr
ptot1 = 0 /* Player total card points hand 1 */
ptot2 = 0 /* Player total card points hand 2 */
dtot = 0 /* Dealer total card points */
busted = 0
busted1 = 0
busted2 = 0
dlbusted = 0
twone = 0
twone1 = 0
twone2 = 0
bj1 = 0
bj2 = 0
acecount = 0
call Play1
PLAY1:
say ''cr
say ''cr
do i = 1 to 2
call getcard
h1.i = RCD
end
do i = 1 to 2
call getcard
d.i = RCD
end
BJ = 0 /* BlackJack if = 1 */
cc = 2 /* card count */
dc = 2 /* dealers card count */
splh = 0 /* This hand is a split hand if 1 */
splm = 0 /* display the Split menu if 1 */
ddnm = 0 /* Display the DD menu if 1 */
ddnh = 0 /* This hand is Double Down'ed if 1 */
call play2
PLAY2:
if chicgame ~=1 then call header
say ''cr
say ''cr
say' Amount bet > $'abet' Your available cash > $'avc''cr
say ''cr
say' 'bak6'Your Hand >'def' 'pen6''h1.1' 'h1.2' 'h1.3' 'h1.4' 'h1.5' 'h1.6' 'h1.7' 'h1.8''def''cr
call CPTOT h1 splh
say ''cr
say' 'bak6'Your total >'def' 'pen6''ptot1''def''cr
say ''cr
say' 'bak2'Dealers Hand >'def''pen2' # 'd.2' 'd.3' 'd.4' 'd.5' 'd.6' 'd.7' 'd.8''def''cr
say ''cr
say' 'bak2'Dealers total >'def''pen2' ?'def''cr
say ''cr
say ''cr
if cc = 2 & ptot1 = 21 then call BLACKJACK
say ' 1.Draw a card (Dealer must stand on 17, hit on 16)'cr
say ' 2.Stand'cr
if cc = 2 & h1.1 = h1.2 then splm = 1
else splm = 0
if splm = 1 then do
if abet > avc then do
say ' You don''t have enough cash to Split this hand!'cr
splm = 0
end
else say ' 3.Split'cr
end
if cc = 2 then call checkdd
say ''cr
if chicgame = 1 then quitopt = ''
else quitopt = '(Q = Quit)'
options prompt ' Your choice ? 'quitopt' > '
pull ans
select
when ans = 'Q' then do
if chicgame ~=1 then call QUIT
else call PLAY2
end
when ans = 1 then do
h1 = 1
call DRAW h1 splh
end
when ans = 2 then do
h1 = 1
call STAND h1 splh
end
when ans = 3 then do
select
when splm = 1 then call SPLIT
when splm = 0 & ddnm = 1 then call DDOWN
otherwise call PLAY2
end
end
when ans = 4 then do
if splm = 1 & ddnm = 1 then call DDOWN
else call PLAY2
end
otherwise call PLAY2
end
/*---------------------ROUTINES-----------------------*/
DDOWN:
say ''cr
ddbet = abet + abet
avc = avc - abet
abet = ddbet
call sac70'OK, we''ll double your bet to $'ddbet','
call sac70'and you''ll get one card.'
say ''cr
call sac70'Your available cash is now $'avc''
call delay(50)
say ''cr
call getcard
h1.3 = rcd
whatcard = h1
call cptot whatcard splh
call sac70'You draw your one card and get'
say ''cr
select
when rcd = A then pre = 'an'
when rcd = 8 then pre = 'an'
otherwise pre = 'a'
end
call sac70''pre' 'h1.3''
say ''cr
say' 'bak6'Your cards :'def' 'pen6''h1.1' 'h1.2' 'h1.3''def' 'bak6'Your total :'def' 'pen6''ptot1''def''cr
say ''cr
call pressreturn
say ''cr
call sac70'Ok, let''s see if the Dealer can beat that!'
say ''cr
call dlrturn
SPLIT:
splh = 1 /* This is a split hand */
say ''cr
call sac70'OK, let''s split your 'pen6''h1.1''def'''s into two hands.'
call sac70''def'You''ll be playing for $'abet' on 'pen3'EACH hand!'def''
avc = avc - abet
totwager = abet * 2
say ''cr
h1done = 0 /* signals when hand 1 is done and move to hand 2 */
cch1 = 1
cch2 = 1
busted1 = 0
busted2 = 0
twone1 = 0
h1winner = 0
h2winner = 0
select
when h1.1 = 'A' then ptot1 = 11
when h1.1 = 'K' then ptot1 = 10
when h1.1 = 'Q' then ptot1 = 10
when h1.1 = 'J' then ptot1 = 10
otherwise ptot1 = h1.1
end
select
when h1.2 = 'A' then ptot2 = 11
when h1.2 = 'K' then ptot2 = 10
when h1.2 = 'Q' then ptot2 = 10
when h1.2 = 'J' then ptot2 = 10
otherwise ptot2 = h1.2
end
call pressreturn
say ''cr
call SPLIT1
SPLIT1:
if chicgame ~=1 then call header
say ''cr
say' Amount bet > $'abet' per hand. Your available cash > $'avc''cr
say ''cr
say' 'bak6'Your Hand # 1 >'def' 'pen6''h1.1' 'h1.3' 'h1.4' 'h1.5' 'h1.6' 'h1.7' 'h1.8''def''cr
say ''cr
if busted1 = 1 then isitbusted = ''pen3'BUSTED!'def''
if busted1 = 0 then isitbusted = ''
say' 'bak6'Your Total # 1 >'def' 'pen6''ptot1' 'isitbusted''cr
say ''cr
say' 'bak5'Your Hand # 2 >'def' 'pen5''h1.2' 'h2.2' 'h2.3' 'h2.4' 'h2.5' 'h2.6' 'h2.7' 'h2.8''def''cr
say ''cr
say' 'bak5'Your Total # 2 >'def' 'pen5''ptot2''def''cr
say ''cr
say' 'bak2'Dealers Hand >'def''pen2' # 'd.2' 'd.3' 'd.4' 'd.5' 'd.6' 'd.7' 'd.8''def''cr
say ''cr
if busted1 = 1 then h1done = 1
if h1done = 0 then hnum = ''pen6'Hand # 1'def''
if h1done = 1 then hnum = ''pen5'Hand # 2'def''
say' 'bak2'Dealers total >'def''pen2' ?'def' 'bak4'Currently playing'def' 'hnum''cr
say ''cr
say ' 1.Draw a card (Dealer must stand on 17, hit on 16)'cr
say ' 2.Stand'cr
say