CRAPS by Adrian Mettler, June-July 1997
(kazmet@zapcom.net, http://www.zapcom.net/~kazmet/a)
CRAPS:
This is a version of the casino dice game Craps for the TI-81* calculator.
It is a simple "bare bones" version with few features designed to take up
minimal space on the calculator.
DESCRIPTION:
Craps is a dice game played against the "house". The roller rolls two
dice. If the dice come up totaling 2, 3, or 12 on this first roll, the
house takes the bet made by the roller. If the dice total 7 or 11, the
player automatically wins. For any other number, they must continue
rolling until they roll a 7 or the original number. If they roll a 7
before "making the point", they lose their bet. If they are able to roll
the original number before rolling a 7, they win their bet. This scheme is
slightly more favorable to the house, so over time casinos make a profit.
HOW TO PLAY:
Play is pretty straightforward. Press Enter to clear the opening screen.
Key in your bet and press Enter. After seeing the results of each roll,
press enter to continue and key in your bet again when necessary. To quit,
enter a bet of 0 when prompted and you shall be uncerimoniously kicked out.
NOTES:
You may bet negative quanities; this means you are betting that you will
lose (a bet for the house). The messages saying whether you won or lost
will then be incorrect (at least how your pocketbook is concerned). The
game has a $200 credit limit; this can be changed by altering the value on
line 9 of Prgm1(CRAPS). To remove the limit entirely, omit lines 9, 10,
and the last two lines of Prgm1(CRAPS).
The game is actually composed of two "programs" on the calculator, the
main one (CRAPS) and the CRAPROLL subroutine. You only need to run CRAPS
to play.
--
*It should work for the other models in this series also, but might
need minor modifications.
--start program code--
Prgm1:CRAPS (the main program- 235 bytes)
:0 -> M (-> is the [STO>] key)
:ClrHome
:Disp "CASINO CRAPS"
:Lbl 1
:Pause
:ClrHome
:Disp "MONEY"
:Disp M
:If M<-200 (use the [(-)] key)
:Goto B
:Disp "BET? 0=QUIT"
:Input B
:If B=0
:End
:PrgmZ (this executes the CRAPROLL subroutine)
:If (R=2)+(R=3)+(R=12) (the TI-81's way of saying "If R=2 or R=3 or R=12")
:Goto L
:If (R=7)+(R=11)
:Goto W
:R -> G
:Lbl T
:Disp "MAKE POINT-"
:Disp G
:Disp ""
:PrgmZ
:Pause
:If R=7
:Goto L
:If R=G
:Goto W
:Goto T
:Lbl W
:Disp "YOU WON"
:M+B -> M
:Goto 1
:Lbl L
:Disp "YOU LOST"
:M-B -> M
:Goto 1
:Lbl B
:Disp "BANKRUPT!" (end of prgm1)
PrgmZ:CRAPROLL (the dice-rolling subroutine- 27 bytes)
:Int Rand6+1 -> X
:Disp X
:Int Rand6+1 -> Y
:Disp Y
:X+Y -> R (end of prgmZ)
--end program code (235+27=262 bytes)--