Home Stretch

Greatest Ever 10 May 2014 21:36

Here is the final code (without bug fixes and possible rule changes):

```
prgmCLEAR
ClrHome
DelVar X
1000→Z
1000→θ
Output(2,3,"POKER ALPHA"
Output(8,2,"PRESS ANY KEY"
Output(4,4,"2,598,960
Output(5,4,"VARIETIES"
ClrList L₁,L₂
Repeat Ans
getKey→A
End
Lbl 2
ClrHome
Output(2,3,"PRESS ENTER"
Output(3,5,"TO DRAW"
Pause
ClrHome
"ACE 2 3 4 5 6 7 8 9 10 JACK QUEENKING "→Str1
"SPADES DIAMONDSHEARTS CLUBS "→Str2
DelVar BDelVar CDelVar DDelVar E
randInt(0,12)→B
randInt(0,12)→C
randInt(0,12)→D
randInt(0,12)→E
randInt(0,12)→F
randInt(0,3)→J
randInt(0,3)→K
randInt(0,3)→L
randInt(0,3)→M
randInt(0,3)→N
DelVar A
Lbl 3
ClrHome
DelVar Str3
Output(2,1,sub(Str1,1+5B,5
Output(2,6,"OF"
Output(2,9,sub(Str2,1+8J,8
Output(3,1,sub(Str1,1+5C,5
Output(3,6,"OF"
Output(3,9,sub(Str2,1+8K,8
1→A
Goto R
Lbl 4
DelVar Str3
ClrHome
Output(2,1,sub(Str1,1+5B,5
Output(2,6,"OF"
Output(2,9,sub(Str2,1+8J,8
Output(3,1,sub(Str1,1+5C,5
Output(3,6,"OF"
Output(3,9,sub(Str2,1+8K,8
Output(4,1,sub(Str1,1+5D,5))
Output(4,6,"OF"
Output(4,9,sub(Str2,1+8L,8
2→A
Goto R
Lbl 5
ClrHome
Output(2,1,sub(Str1,1+5B,5
Output(2,6,"OF"
Output(2,9,sub(Str2,1+8J,8
Output(3,1,sub(Str1,1+5C,5
Output(3,6,"OF"
Output(3,9,sub(Str2,1+8K,8
Output(4,1,sub(Str1,1+5D,5
Output(4,6,"OF"
Output(4,9,sub(Str2,1+8L,8
Output(5,1,sub(Str1,1+5E,5
Output(5,6,"OF"
Output(5,9,sub(Str2,1+8M,8
3→A
Goto R
Lbl 6
ClrHome
Output(2,1,sub(Str1,1+5B,5
Output(2,6,"OF"
Output(2,9,sub(Str2,1+8J,8
Output(3,1,sub(Str1,1+5C,5
Output(3,6,"OF"
Output(3,9,sub(Str2,1+8K,8
Output(4,1,sub(Str1,1+5D,5
Output(4,6,"OF"
Output(4,9,sub(Str2,1+8L,8
Output(5,1,sub(Str1,1+5E,5
Output(5,6,"OF"
Output(5,9,sub(Str2,1+8M,8
Output(6,1,sub(Str1,1+5F,5
Output(6,6,"OF"
Output(6,9,sub(Str2,1+8N,8
A+1→A
Goto R
Lbl R
Input "REDRAW?",Str3
If Str3="N"Dec="NO"
Then
Goto Y
Else
If Str3="1"
Then
ClrHome
randInt(0,12)→B
randInt(0,3)→J
Else
If Str3="2"
Then
ClrHome
randInt(0,12)→C
randInt(0,3)→K
Else
If Str3="3"
Then
ClrHome
randInt(0,12)→D
randInt(0,3)→L
Else
If Str3="4"
Then
ClrHome
randInt(0,12)→E
randInt(0,3)→M
Else
If Str3="5"
Then
ClrHome
randInt(0,12)→F
randInt(0,3)→N
End
If A>1
A-1→A
Goto Y
Else
Goto 3
End
Lbl Y
If A=1
Then
Goto 4
Else
If A=2
Then
Goto 5
Else
If A=3
Then
Goto 6
Else
If A=4
Then
Goto X
Lbl X
Pause
If B=0
Then
13→B
Else
If C=0
Then
13→C
Else
If D=0
Then
13→D
Else
If E=0
Then
13→E
Else
If F=0
Then
13→F
End
B→L₁(1+dim(L₁
C→L₁(1+dim(L₁
D→L₁(1+dim(L₁
E→L₁(1+dim(L₁
F→L₁(1+dim(L₁
ClrHome
Disp "CURRENT MONEY:"
Disp Z
Input "WAGER: ",Y
Z-Y→Z
θ-Y→θ
randInt(1,13)→O
randInt(1,13)→P
randInt(1,13)→Q
randInt(1,13)→R
randInt(1,13)→S
randInt(0,3)→T
randInt(0,3)→U
randInt(0,3)→V
randInt(0,3)→W
randInt(0,3)→G
O→L₂(1+dim(L₂
P→L₂(1+dim(L₂
Q→L₂(1+dim(L₂
R→L₂(1+dim(L₂
S→L₂(1+dim(L₂
sum(L₁)→I
sum(L₂)→J
If I=J
Then
Output(8,1,"DRAW"
Z+Y→Z
θ+Y→θ
Pause
Goto A
Else
If I>J
Then
Output(8,1,"YOU WIN!"
Z+2Y→Z
θ-Y→θ
Pause
Goto A
Else
If I<J
Then
Output(8,1,"YOU LOSE."
Z-Y→Z
θ+2Y→θ
Pause
Goto A
End
Lbl A
If O=13
Then
0→O
Else
If P=13
Then
0→P
Else
If Q=13
Then
0→Q
Else
If R=13
Then
0→R
Else
If S=13
0→S
End
ClrHome
Output(1,1,"OPPONENT DREW:"
Output(2,1,sub(Str1,1+5O,5
Output(3,1,sub(Str1,1+5P,5
Output(4,1,sub(Str1,1+5Q,5
Output(5,1,sub(Str1,1+5R,5
Output(6,1,sub(Str1,1+5S,5
Output(2,6,"OF"
Output(3,6,"OF"
Output(4,6,"OF"
Output(5,6,"OF"
Output(6,6,"OF"
Output(2,9,sub(Str2,1+8T,8
Output(3,9,sub(Str2,1+8U,8
Output(4,9,sub(Str2,1+8V,8
Output(5,9,sub(Str2,1+8W,8
Output(6,9,sub(Str2,1+8G,8
Pause
If Z=0
Then
ClrHome
Output(1,1,"YOU LOST IT ALL!"
Pause
Stop
Else
If θ=0
Then
Output(1,1,"YOU CLEANED HOUSE!"
Pause
Stop
Else
If Z>0 and θ>0
Then
Goto 2
End
```

Some bugs I am experiencing include glitchy second rounds and the program stopping abruptly. I have tried to make changes to fix these, but to no avail. With your help, I know this can be fixed and improved far better than I could!