

Poker, by Doug Zuckerman.  1996.  Email: dszucker@students.wisc.edu

						RLG28@aol.com



This is the most comprehensive poker program available for the TI-82.

It implements a new 52 card deck for each new hand.



Limitations:

	For unknown reasons, this program does not run properly on some TI-82's.

I have noticed that some TI-82's which have a black outline around the LCD have this problem.

I apologize for the incovenience, but there is nothing I can do since I do not understand why this

happens.  If you have any ideas please email me.





----begin documentation----

Poker, by Doug Zuckerman.  1996.  Email: dszucker@students.wisc.edu

						RLG28@aol.com



This is the most comprehensive poker program available for the TI-82.

It implements a new 52 card deck for each new hand.



Limitations:

	For unknown reasons, this program does not run properly on some TI-82's.

I have noticed that some TI-82's which have a black outline around the LCD have this problem.

I apologize for the incovenience, but there is nothing I can do since I do not understand why this

happens.  If you have any ideas please email me.







----begin ascii----

\START82\

\COMMENT=Program file dated 10/08/96, 22:46

\NAME=POKER

\FILE=C:\WINLINK\POKER.82P

:Func:FullScreen

:FnOff :PlotsOff 

:AxesOff

:0\->\Xmin:94\->\Xmax

:0\->\Ymin:62\->\Ymax

:ClrDraw:ClrHome

:For(X,1,39)

:Text(15,X,"POKER")

:Text(15,X-1," ")

:Text(22,84-X,"BY")

:End

:Text(29,21,"DOUG ZUCKERMAN")

:Text(36,41,"1996")

:Pause 

:Lbl 3

:Menu(" POKER ","CONTINUE LAST",4,"NEW GAME",5,"INSTRUCTIONS",6,"QUIT",\#\

7,"BLACKJACK",8,"RED DOG",9)

:Lbl 5

:1000\->\F

:Lbl 4

:If F=0:Then

:ClrHome

:Output(4,4,"OUTTA CASH!")

:Pause 

:Goto 3

:End

:Lbl 0

:ClrHome

:Disp "YOU HAVE",F,"DOLLARS.","HOW MUCH WOULD","YOU LIKE"

:Input "TO BET?",H

:If H\<=\0 or H>F:Goto 0

:ClrDraw

:ClrList \L1\,\L2\,\L3\,\L4\,\L5\,\L6\

:6\->\dim \L2\

:22\->\dim \L4\

:3\->\dim \L5\

:6\->\dim \L6\

:For(X,2,14)

:X\->\\L1\(X-1)

:End

:For(X,2,14)

:X\->\\L1\(X+12)

:End

:For(X,2,14)

:X\->\\L1\(X+25)

:End

:For(X,2,14)

:X\->\\L1\(X+38)

:End

:0\->\O

:0\->\Y

:2\->\R:15\->\W

:For(X,1,76,15)

:Line(X,40,X,34)

:End

:Horizontal 41

:Horizontal 33

:Horizontal 1

:Horizontal 9

:Line(0,1,0,9)

:Line(94,1,94,9)

:Pt-Off(0,41)

:Pt-Off(0,33)

:Line(94,40,94,34)

:Line(77,51,77,61)

:Line(78,51,78,61)

:Line(83,60,83,52)

:Line(84,53,84,59)

:Line(86,61,94,61)

:Line(86,51,93,51)

:Line(85,51,94,61)

:Line(86,51,93,61)

:Line(79,51,82,51)

:Line(79,61,82,61)

:Line(87,52,94,52)

:Line(85,60,93,60)

:For(L,1,5)

:Text(22,Y+8,L)

:Lbl 2

:int (rand*52)+1\->\Z

:Z\->\\L4\(L+13)

:If \L1\(Z)=0

:Goto 2

:If \L1\(Z)=14

:Text(2,Y+4,"A ")

:If \L1\(Z)=11

:Text(2,Y+4,"J ")

:If \L1\(Z)=12

:Text(2,Y+4,"Q ")

:If \L1\(Z)=13

:Text(2,Y+4,"K ")

:If (\L1\(Z)>1)(\L1\(Z)<11)

:Text(2,Y+4,\L1\(Z))

:If (Z>0)(Z<14)

:Then

:Line(Y+9,47,Y+9,48)

:Line(Y+10,46,Y+10,49)

:Line(Y+11,45,Y+11,48)

:Line(Y+12,46,Y+12,49)

:Line(Y+13,47,Y+13,48):End

:If (Z>13)(Z<27)

:Then

:Line(Y+9,47,Y+13,47)

:Line(Y+11,45,Y+11,49)

:Line(Y+10,46,Y+10,48)

:Line(Y+12,46,Y+12,48):End

:If (Z>26)(Z<40)

:Then

:Line(Y+11,45,Y+11,49)

:Line(Y+10,48,Y+12,48)

:Line(Y+9,47,Y+13,47)

:Line(Y+9,46,Y+13,46):End

:If (Z>39)(Z<53)

:Then

:Line(Y+9,46,Y+9,47)

:Line(Y+10,46,Y+10,49)

:Line(Y+11,45,Y+11,49)

:Line(Y+12,46,Y+12,49)

:Line(Y+13,46,Y+13,47):End

:Line(R,43,R,61)

:Line(W,43,W,61)

:Line(R,43,W,43)

:Line(R,43,W,61)

:Line(R,61,W,61)

:15+R\->\R:15+W\->\W

:Y+15\->\Y

:\L1\(Z)\->\\L3\(L)

:0\->\\L1\(Z)

:If \L2\(1)=1 or \L2\(2)=1 or \L2\(3)=1 or \L2\(4)=1 or \L2\(5)=1:Then

:Goto P

:End

:End

:If \L2\(6)=1:Goto Q

:Lbl G

:getKey\->\G

:If G=105:Then:1\->\\L2\(6):Goto P:End

:If sum \L2\=3:Then

:1\->\\L2\(6):Goto P

:End

:If G=92 and \L2\(1)\<>\1:Then

:1\->\\L2\(1)

:For(X,3,14)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:If G=92 and \L2\(1)=1:Then

:0\->\\L2\(1)

:For(X,3,14)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:If G=93 and \L2\(2)=1:Then

:0\->\\L2\(2)

:For(X,18,29)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:If G=93 and \L2\(2)\<>\1:Then

:1\->\\L2\(2)

:For(X,18,29)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:If G=94 and \L2\(3)=1:Then

:0\->\\L2\(3)

:For(X,33,44)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:If G=94 and \L2\(3)\<>\1:Then

:1\->\\L2\(3)

:For(X,33,44)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:If G=82 and \L2\(4)=1:Then

:0\->\\L2\(4)

:For(X,48,59)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:If G=82 and \L2\(4)\<>\1:Then

:1\->\\L2\(4)

:For(X,48,59)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:If G=83 and \L2\(5)=1:Then

:0\->\\L2\(5)

:For(X,63,74)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:If G=83 and \L2\(5)\<>\1:Then

:1\->\\L2\(5)

:For(X,63,74)

:For(Y,44,60)

:Pt-Change(X,Y)

:End

:End

:Goto G

:End

:Goto G

:Lbl P

:If \L2\(1)=1:Then

:0\->\Y:2\->\R:15\->\W

:1\->\L

:\L2\(1)+1\->\\L2\(1)

:For(X,2,15)

:Line(X,43,X,61,0)

:End

:Goto 2

:End

:If \L2\(2)=1:Then

:15\->\Y:17\->\R:30\->\W

:2\->\L

:\L2\(2)+1\->\\L2\(2)

:For(X,17,30)

:Line(X,43,X,61,0)

:End

:Goto 2

:End

:If \L2\(3)=1:Then

:30\->\Y:32\->\R:45\->\W

:3\->\L

:\L2\(3)+1\->\\L2\(3)

:For(X,32,45)

:Line(X,43,X,61,0)

:End

:Goto 2

:End

:If \L2\(4)=1:Then

:45\->\Y:47\->\R:60\->\W

:4\->\L

:\L2\(4)+1\->\\L2\(4)

:For(X,47,60)

:Line(X,43,X,61,0)

:End

:Goto 2

:End

:If \L2\(5)=1:Then

:60\->\Y:62\->\R:75\->\W

:5\->\L

:\L2\(5)+1\->\\L2\(5)

:For(X,62,75)

:Line(X,43,X,61,0)

:End

:Goto 2

:End

:Lbl Q

:SortA(\L3\)

:0\->\A:1\->\B

:For(X,1,14)

:A+1\->\A:B+1\->\B

:For(L,1,5)

:If \L3\(L)=B

:\L4\(A)+1\->\\L4\(A)

:End

:End

:For(L,1,13)

:If \L4\(L)=2:Then

:\L5\(1)+2\->\\L5\(1)

:L+1\->\\L6\(3):End

:If \L4\(L)=3:Then

:\L5\(2)+3\->\\L5\(2)

:L+1\->\\L6\(3):End

:If \L4\(L)=4:Then

:\L5\(3)+4\->\\L5\(3)

:L+1\->\\L6\(3):End

:End

:\(-)\13\->\A:1\->\B:18\->\C

:For(X,1,5)

:A+13\->\A:B+13\->\B

:C+1\->\C

:For(L,14,18)

:If (\L4\(L)>A) and (\L4\(L)<B)

:\L4\(C)+1\->\\L4\(C)

:End

:End

:For(X,34,40)

:Line(2,X,93,X,0)

:End

:If (\L5\(1)=2) and (\L5\(2)=0)

:1\->\\L6\(1)

:If (\L5\(1)=4) and (\L5\(3)=0)

:2\->\\L6\(1)

:If (\L5\(2)=3) and (\L5\(1)=0)

:3\->\\L6\(1)

:If (\L3\(1)+1=\L3\(2)) and (\L3\(2)+1=\L3\(3)) and (\L3\(3)+1=\L3\(4))\#\

 and (\L3\(4)+1=\L3\(5))

:4\->\\L6\(1)

:If (\L3\(5)=14) and (\L3\(1)=2) and (\L3\(2)=3) and (\L3\(3)=4) and (\L3\\#\

(4)=5)

:4\->\\L6\(1)

:If (\L4\(19)=5) or (\L4\(20)=5) or (\L4\(21)=5) or (\L4\(22)=5)

:\L6\(1)+5\->\\L6\(1)

:If (\L5\(1)=2) and (\L5\(2)=3)

:6\->\\L6\(1)

:If \L5\(3)=4

:7\->\\L6\(1)

:Text(22,3,"YOU HAVE:")

:If \L6\(1)=0

:Text(22,36,"NOTHING")

:If \L6\(1)=1

:Text(22,36,"ONE PAIR")

:If \L6\(1)=2

:Text(22,36,"TWO PAIRS")

:If \L6\(1)=3

:Text(22,36,"THREE OF A KIND")

:If \L6\(1)=4

:Text(22,36,"A STRAIGHT")

:If \L6\(1)=5

:Text(22,36,"A FLUSH")

:If \L6\(1)=6

:Text(22,36,"A FULL HOUSE")

:If \L6\(1)=7

:Text(22,36,"FOUR OF A KIND")

:If \L6\(1)=9

:Text(22,36,"A STRAIGHT FLUSH")

:\L3\(5)\->\\L6\(2)

:ClrList \L2\,\L3\,\L4\,\L5\

:6\->\dim \L2\

:22\->\dim \L4\

:3\->\dim \L5\

:0\->\O:0\->\Y

:2\->\R:15\->\W

:For(L,1,5)

:Lbl 1

:int (rand*52)+1\->\Z

:\L1\(Z)+Z/100\->\\L3\(L)

:Z\->\\L4\(L+13)

:If \L1\(Z)=0

:Goto 1

:0\->\\L1\(Z)

:End

:If \L2\(1)=1 or \L2\(2)=1 or \L2\(3)=1 or \L2\(4)=1 or \L2\(5)=1:Goto \#\

W

:If \L2\(6)=1:Goto H

:SortA(\L3\)

:1\->\\L2\(6)

:If (iPart \L3\(1)=iPart \L3\(2)) and (iPart \L3\(2)=iPart \L3\(3)) and\#\

 (iPart \L3\(4)=iPart \L3\(5)):Goto W

:If (iPart \L3\(1)=iPart \L3\(2)) and (iPart \L3\(3)=iPart \L3\(4)) and\#\

 (iPart \L3\(4)=iPart \L3\(5)):Goto W

:If (iPart \L3\(1)=iPart \L3\(2)) and (iPart \L3\(3)=iPart \L3\(4)):The\#\

n

:1\->\\L2\(5):Goto W

:End

:If (iPart \L3\(1)=iPart \L3\(2)) and (iPart \L3\(4)=iPart \L3\(5)):The\#\

n

:1\->\\L2\(3):Goto W

:End

:If (iPart \L3\(2)=iPart \L3\(3)) and (iPart \L3\(4)=iPart \L3\(5)):The\#\

n

:1\->\\L2\(1):Goto W

:End

:If (iPart \L3\(1)=iPart \L3\(2)) and (iPart \L3\(2)=iPart \L3\(3)):The\#\

n

:1\->\\L2\(4):1\->\\L2\(5)

:Goto W:End

:If (iPart \L3\(2)=iPart \L3\(3)) and (iPart \L3\(3)=iPart \L3\(4)):The\#\

n

:1\->\\L2\(1):1\->\\L2\(5)

:Goto W:End

:If (iPart \L3\(3)=iPart \L3\(4)) and (iPart \L3\(4)=iPart \L3\(5)):The\#\

n

:1\->\\L2\(1):1\->\\L2\(2)

:1\->\\L2\(3):Goto W

:End

:If iPart \L3\(1)=iPart \L3\(2):Then

:1\->\\L2\(3):1\->\\L2\(4)

:1\->\\L2\(5):Goto W

:End

:If iPart \L3\(2)=iPart \L3\(3):Then

:1\->\\L2\(1):1\->\\L2\(4)

:1\->\\L2\(5):Goto W

:End

:If iPart \L3\(3)=iPart \L3\(4):Then

:1\->\\L2\(1):1\->\\L2\(2)

:1\->\\L2\(5):Goto W

:End

:If iPart \L3\(4)=iPart \L3\(5):Then

:1\->\\L2\(1):1\->\\L2\(2)

:1\->\\L2\(3):Goto W

:End

:For(X,1,3)

:1\->\\L2\(X)

:End

:Lbl W

:If \L2\(1)=1:Then

:1\->\L:\L2\(1)+1\->\\L2\(1):Goto 1:End

:If \L2\(2)=1:Then

:2\->\L:\L2\(2)+1\->\\L2\(2):Goto 1:End

:If \L2\(3)=1:Then

:3\->\L:\L2\(3)+1\->\\L2\(3):Goto 1:End

:If \L2\(4)=1:Then

:4\->\L:\L2\(4)+1\->\\L2\(4):Goto 1:End

:If \L2\(5)=1:Then

:5\->\L:\L2\(5)+1\->\\L2\(5):Goto 1:End

:Lbl H

:For(Z,1,5)

:If iPart \L3\(Z)=14

:Text(34,Y+4,"A ")

:If iPart \L3\(Z)=11

:Text(34,Y+4,"J ")

:If iPart \L3\(Z)=12

:Text(34,Y+4,"Q ")

:If iPart \L3\(Z)=13

:Text(34,Y+4,"K ")

:If (iPart \L3\(Z)>1)(iPart \L3\(Z)<11)

:Text(34,Y+4,iPart \L3\(Z))

:If (fPart \L3\(Z)*100>0)(fPart \L3\(Z)*100<14)

:Then

:Line(Y+9,15,Y+9,16)

:Line(Y+10,14,Y+10,17)

:Line(Y+11,13,Y+11,16)

:Line(Y+12,14,Y+12,17)

:Line(Y+13,15,Y+13,16):End

:If (fPart \L3\(Z)*100>13)(fPart \L3\(Z)*100<27)

:Then

:Line(Y+9,15,Y+13,15)

:Line(Y+11,13,Y+11,17)

:Line(Y+10,14,Y+10,16)

:Line(Y+12,14,Y+12,16):End

:If (fPart \L3\(Z)*100>26)(fPart \L3\(Z)*100<40)

:Then

:Line(Y+11,13,Y+11,17)

:Line(Y+10,16,Y+12,16)

:Line(Y+9,15,Y+13,15)

:Line(Y+9,14,Y+13,14):End

:If (fPart \L3\(Z)*100>39)(fPart \L3\(Z)*100<53)

:Then

:Line(Y+9,14,Y+9,15)

:Line(Y+10,14,Y+10,17)

:Line(Y+11,13,Y+11,17)

:Line(Y+12,14,Y+12,17)

:Line(Y+13,14,Y+13,15):End

:Line(R,11,R,29)

:Line(W,11,W,29)

:Line(R,11,W,11)

:Line(R,11,W,29)

:Line(R,29,W,29)

:15+R\->\R:15+W\->\W

:Y+15\->\Y

:End

:Lbl I

:iPart \L3\\->\\L3\

:SortA(\L3\)

:0\->\A:1\->\B

:For(X,1,14)

:A+1\->\A:B+1\->\B

:For(L,1,5)

:If \L3\(L)=B

:\L4\(A)+1\->\\L4\(A)

:End

:End

:For(L,1,13)

:If \L4\(L)=2:Then

:\L5\(1)+2\->\\L5\(1)

:L+1\->\\L6\(6):End

:If \L4\(L)=3:Then

:\L5\(2)+3\->\\L5\(2)

:L+1\->\\L6\(6):End

:If \L4\(L)=4:Then

:\L5\(3)+4\->\\L5\(3)

:L+1\->\\L6\(6):End

:End

:\(-)\13\->\A:1\->\B:18\->\C

:For(X,1,5)

:A+13\->\A:B+13\->\B

:C+1\->\C

:For(L,14,18)

:If (\L4\(L)>A) and (\L4\(L)<B)

:\L4\(C)+1\->\\L4\(C)

:End

:End

:If (\L5\(1)=2) and (\L5\(2)=0)

:1\->\\L6\(4)

:If (\L5\(1)=4) and (\L5\(3)=0)

:2\->\\L6\(4)

:If (\L5\(2)=3) and (\L5\(1)=0)

:3\->\\L6\(4)

:If (\L3\(1)+1=\L3\(2)) and (\L3\(2)+1=\L3\(3)) and (\L3\(3)+1=\L3\(4))\#\

 and (\L3\(4)+1=\L3\(5))

:4\->\\L6\(4)

:If (\L3\(5)=14) and (\L3\(1)=2) and (\L3\(2)=3) and (\L3\(3)=4) and (\L3\\#\

(4)=5)

:4\->\\L6\(4)

:If (\L4\(19)=5) or (\L4\(20)=5) or (\L4\(21)=5) or (\L4\(22)=5)

:\L6\(4)+5\->\\L6\(4)

:If (\L5\(1)=2) and (\L5\(2)=3)

:6\->\\L6\(4)

:If \L5\(3)=4

:7\->\\L6\(4)

:Text(54,3,"DOUG HAS:")

:If \L6\(4)=0

:Text(54,36,"NOTHING")

:If \L6\(4)=1

:Text(54,36,"ONE PAIR")

:If \L6\(4)=2

:Text(54,36,"TWO PAIRS")

:If \L6\(4)=3

:Text(54,36,"THREE OF A KIND")

:If \L6\(4)=4

:Text(54,36,"A STRAIGHT")

:If \L6\(4)=5

:Text(54,36,"A FLUSH")

:If \L6\(4)=6

:Text(54,36,"A FULL HOUSE")

:If \L6\(4)=7

:Text(54,36,"FOUR OF A KIND")

:If \L6\(4)=9

:Text(54,36,"A STRAIGHT FLUSH")

:\L3\(5)\->\\L6\(5)

:Pause 

:If \L6\(1)>\L6\(4)

:Goto A

:If \L6\(4)>\L6\(1)

:Goto B

:If \L6\(4)=\L6\(1)

:Goto C

:Lbl A

:ClrHome

:Output(4,5,"YOU WIN!")

:F+H\->\F:Pause 

:Goto 4

:Lbl B

:ClrHome

:Output(4,4,"DOUG WINS!")

:F-H\->\F:Pause 

:Goto 4

:Lbl C

:If \L6\(3)>\L6\(6)

:Goto A

:If \L6\(6)>\L6\(3)

:Goto B

:If \L6\(6)=\L6\(3)

:Goto D

:Lbl D

:If \L6\(2)>\L6\(5)

:Goto A

:If \L6\(5)>\L6\(2)

:Goto B

:If \L6\(5)=\L6\(2)

:Goto 4

:Lbl 7

:AxesOn:ZDecimal

:ClrList \L1\,\L2\,\L3\,\L4\,\L5\,\L6\

:Stop

:Lbl 6

:ClrHome

:Disp "PRESS THE","NUMBER UNDER","EACH CARD THAT","YOU WANT TO","GET RI\#\

D OF."," ","THEN PRESS ENTER"

:Pause 

:Goto 3

:Lbl 8

:prgmBLACKJAC

:Lbl 9

:prgmREDDOG

\STOP82\

