Blackjack

Blackjack was my attempt at “real” graphics on the TI-82.

blackjack.zip

BLACKJAC:

\START82\
\COMMENT=Program file dated 01/20/80, 00:00
\NAME=BLACKJAC
\FILE=BLACKJAC.82P
ClrHome
Disp “+————-+”
Disp “! YOU ARE !”
Disp “! PLAYING !”
Disp “! VIDEO 21 !”
Disp “! VERSION 2 !”
Disp “+————-+”
Pause :ClrHome
Disp “+————–+”
Disp “! WRITTEN BY !”
Disp “! SCOTT WENDT !”
Disp “+————–+”
Pause :ClrHome
Lbl 1
Disp “HOW MUCH WILL”
Disp “YOU BE PLAYING”
Disp “WITH TODAY”
Input G
ClrHome
0\->\\@\
If G>9999
Then
Disp “WE CAN NOT HOLD”
Disp “THAT MUCH CASH!”
Pause :ClrHome
1\->\\@\
End
If \@\=1
Goto 1
52\->\C
prgm[A21
\STOP82\

@A21:

\START82\
\COMMENT=Program file dated 01/20/80, 00:01
\NAME=\@\A21
\FILE=ZA21.82P
ClrDraw
FnOff
PlotsOff
AxesOff
ZDecimal
If G\<=\0
prgm[A21BRK
prgm[A21SHUF
prgm[A21BET
\STOP82\

@A21AGN:

\START82\
\COMMENT=Program file dated 01/20/80, 00:01
\NAME=\@\A21AGN
\FILE=ZA21AGN.82P
Text(0,3,”PLAY AGAIN”)
Text(26,3,”1) YES 2) NO \#\
“)
getKey
Lbl A
getKey\->\K
If K=92
prgm[A21
If K=93
Goto B
Goto A
Lbl B
ClrDraw
ClrHome
Disp
FnOn
AxesOn
Disp “+————–+”
Disp “! YOU GET !”
Disp “! !”
Output(3,4,G)
Disp “! COME AGAIN !”
Disp “+————–+”
Stop
\STOP82\

@A21BET:

\START82\
\COMMENT=Program file dated 01/20/80, 00:01
\NAME=\@\A21BET
\FILE=ZA21BET.82P
1\->\M
0\->\\@\
Text(26,70,G)
Text(55,80,M)
Text(26,3,”ENTER BET”)
Text(55,M,”I”)
getKey
Lbl 1
getKey\->\K
If K=26 and M<50
Then
M+1\->\M
Text(55,M,”I”)
Text(55,80,M,” “)
End
If K=24 and M>1
Then
Text(55,M,” “)
M-1\->\M
Text(55,80,M,” “)
End
If K=95 and M<46
Then
If M\<>\1
Then
For(\@\,1,5)
M+1\->\M
Text(55,M,”I”)
End
End
If M=1
Then
For(\@\,1,4)
M+1\->\M
Text(55,M,”I”)
End
End
Text(55,80,M,” “)
End
If K=85 and M>4
Then
0\->\\@\
If M=5
Then
For(\@\,1,4)
Text(55,M,” “)
M-1\->\M
End
1\->\\@\
End
If M\<>\5 and \@\=0
Then
For(\@\,1,5)
Text(55,M,” “)
M-1\->\M
End
End
Text(55,80,M,” “)
End
If K=105
Goto 2
Goto 1
Lbl 2
Text(26,3,” \#\

1\->\O
1\->\\@\
prgm[A21SC
Text(0,3,”PLAYER 1″)
Text(26,3,”1) HIT 2) STAY”)
getKey
Lbl A
getKey\->\K
If K=92
Then
Q+1\->\Q
If Q>6
Then
Goto B
End
Q\->\\@\
prgm[A21DEAL
V\->\[B](\@\,1)
S\->\[B](\@\,2)
C+1\->\C
1\->\O
prgm[A21DC
prgm[A21SC
prgm[A21TC
Goto A
End
If K=93
Goto B
Goto A
Lbl B
Text(0,3,”COMPUTER”)
Text(26,3,” \#\
“)
Lbl C
If U<16
Then
P+1\->\P
If P>6
Goto D
P\->\\@\
prgm[A21DEAL
V\->\[B](\@\,3)
S\->\[B](\@\,4)
C+1\->\C
2\->\O
prgm[A21DC
prgm[A21SC
prgm[A21TC
Goto C
End
If U\>=\17
Then
For(W,1,100)
End
End
Goto D
Goto C
Lbl D
If T>U
Then
1\->\H
prgm[A21WIN
End
If T<U
Then
2\->\H
prgm[A21WIN
End
If T=U
Then
2\->\H
prgm[A21WIN
End
\STOP82\

@A21BRK:

\START82\
\COMMENT=Program file dated 01/20/80, 00:01
\NAME=\@\A21BRK
\FILE=ZA21BRK.82P
ClrDraw
AxesOn
CoordOn
ClrHome
Disp
If G=0
Then
Disp “YOU ARE BROKE”
Disp “GET OUT OF HERE”
Stop
End
If G<0
Then
Disp “PAY UP THEN”
Disp “GET OUT OF HERE”
Stop
End
\STOP82\

@A21BUST:

\START82\
\COMMENT=Program file dated 01/20/80, 00:01
\NAME=\@\A21BUST
\FILE=ZA21BUST.82P
Text(0,3,” \#\
“)
Text(26,3,” \#\
“)
If O=1
Then
G-M\->\G
Text(26,3,”YOU BUSTED!”)
Text(55,0,” \#\
“)
Text(26,70,G,” “)
Pause
prgm[A21AGN
End
If O=2
Then
M+G\->\G
Text(26,3,”COMPUTER BUSTED!”)
Text(55,0,” \#\
“)
Text(26,70,G,” “)
Pause
prgm[A21AGN
End
\STOP82\

@A21DC:

\START82\
\COMMENT=Program file dated 01/20/80, 00:01
\NAME=\@\A21DC
\FILE=ZA21DC.82P
If O=1
Then
Line(\(-)\4.7+.3+1.2(\@\-1)+.3(\@\-1),2.4,\(-)\4.7+.3+1.2(\@\-1)+.3(\@\\#\
-1),.9)
Line(\(-)\4.7+.3+1.2(\@\-1)+.3(\@\-1),.9,\(-)\4.7+.3+1.2\@\+.3(\@\-1),.\#\
9)
Line(\(-)\4.7+.3+1.2\@\+.3(\@\-1),.9,\(-)\4.7+.3+1.2\@\+.3(\@\-1),2.4)
Line(\(-)\4.7+.3+1.2\@\+.3(\@\-1),2.4,\(-)\4.7+.3+1.2(\@\-1)+.3(\@\-1),\#\
2.4)
End
If O=2
Then
Line(\(-)\4.7+.3+1.2(\@\-1)+.3(\@\-1),\(-)\.5,\(-)\4.7+.3+1.2(\@\-1)+.3\#\
(\@\-1),\(-)\2)
Line(\(-)\4.7+.3+1.2(\@\-1)+.3(\@\-1),\(-)\2,\(-)\4.7+.3+1.2\@\+.3(\@\-\#\
1),\(-)\2)
Line(\(-)\4.7+.3+1.2\@\+.3(\@\-1),\(-)\2,\(-)\4.7+.3+1.2\@\+.3(\@\-1),\(-)\\#\
.5)
Line(\(-)\4.7+.3+1.2\@\+.3(\@\-1),\(-)\.5,\(-)\4.7+.3+1.2(\@\-1)+.3(\@\\#\
-1),\(-)\.5)
End
\STOP82\

@A21DEAL:

\START82\
\COMMENT=Program file dated 01/20/80, 00:02
\NAME=\@\A21DEAL
\FILE=ZA21DEAL.82P
If [A](C,2)\<=\13:Then
1\->\S
[A](C,2)\->\V
Goto 1
End
If [A](C,2)\<=\26:Then
2\->\S
[A](C,2)-13\->\V
Goto 1
End
If [A](C,2)\<=\39:Then
3\->\S
[A](C,2)-26\->\V
Goto 1
End
4\->\S
[A](C,2)-39\->\V
Lbl 1
\STOP82\

@A21SC:

\START82\
\COMMENT=Program file dated 01/20/80, 00:02
\NAME=\@\A21SC
\FILE=ZA21SC.82P
If O=1
11\->\A
If O=2
40\->\A
If O=1
Then
[B](\@\,1)\->\V
[B](\@\,2)\->\S
End
If O=2
Then
[B](\@\,3)\->\V
[B](\@\,4)\->\S
End
6+15(\@\-1)\->\B
Text(A,B,” “)
If V=13
Text(A,B,”K”)
If V=12
Text(A,B,”Q”)
If V=11
Text(A,B,”J”)
If V=10
Text(A,B,”X”)
If V\<=\9
Text(A,B,V)
If V=1
Text(A,B,”A”)
If S=1
Text(A,4+B,”S”)
If S=2
Text(A,4+B,”H”)
If S=3
Text(A,4+B,”C”)
If S=4
Text(A,4+B,”D”)
\STOP82\

@A21SHUF:

\START82\
\COMMENT=Program file dated 01/20/80, 00:02
\NAME=\@\A21SHUF
\FILE=ZA21SHUF.82P
0\->\T:0\->\U:0\->\Q:0\->\P:0\->\F:0\->\E:0\->\B
If (52-C)<17
Then
Text(26,3,”SHUFFLING…”)
{52,2}\->\dim [A]
Fill(0,[A])
{6,4}\->\dim [B]
Fill(0,[B])
For(\@\,1,46)
Lbl 1
int (rand52)+1\->\X
If [A](X,1)\<>\0
Goto 1
X\->\[A](\@\,2)
1\->\[A](X,1)
End
1\->\C
End
ClrDraw
Text(26,3,”DEALING…”)
For(\@\,1,2)
prgm[A21DEAL
V\->\[B](\@\,1)
S\->\[B](\@\,2)
C+1\->\C
1\->\O
Q+1\->\Q
prgm[A21DC
If \@\=2
prgm[A21SC
If \@\=1
Text(11,6,”XX”)
prgm[A21TC
prgm[A21DEAL
V\->\[B](\@\,3)
S\->\[B](\@\,4)
C+1\->\C
P+1\->\P
2\->\O
prgm[A21DC
If \@\=2
prgm[A21SC
If \@\=1
Text(40,6,”XX”)
prgm[A21TC
End
Text(26,3,”DONE… “)
Pause
Return
\STOP82\

@A21TC:

\START82\
\COMMENT=Program file dated 01/20/80, 00:02
\NAME=\@\A21TC
\FILE=ZA21TC.82P
If O=1
Then
If [B](\@\,1)=1
Then
T+11\->\T
F+1\->\F
Goto 2
End
If [B](\@\,1)\<=\10
Then
T+[B](\@\,1)\->\T
Goto 2
End
If [B](\@\,1)>10
T+10\->\T
Lbl 2
If T>21
Then
If F>0
Then
T-10\->\T
F-1\->\F
Goto 2
End
1\->\O
prgm[A21BUST
End
Return
End
If O=2
Then
If [B](\@\,3)=1
Then
U+11\->\U
E+1\->\E
Goto 3
End
If [B](\@\,3)\<=\10
Then
U+[B](\@\,3)\->\U
Goto 3
End
If [B](\@\,3)>10
U+10\->\U
Lbl 3
If U>21
Then
If E>0
Then
U-10\->\U
E-1\->\E
Goto 3
End
2\->\O
prgm[A21BUST
End
Return
End
\STOP82\

@A21WIN:

\START82\
\COMMENT=Program file dated 01/20/80, 00:02
\NAME=\@\A21WIN
\FILE=ZA21WIN.82P
1\->\\@\
2\->\O
prgm[A21SC
Text(0,3,” \#\
“)
Text(26,3,” \#\
“)
If H=2
Then
G-M\->\G
Text(26,3,”COMPUTER WINS!”)
Text(55,0,” \#\
“)
Text(26,70,G,” “)
Pause
prgm[A21AGN
End
If H=1
Then
M+G\->\G
Text(26,3,”YOU WIN!”)
Text(55,0,” \#\
“)
Text(26,70,G,” “)
Pause
prgm[A21AGN
End
\STOP82\