|
Home Bolo Programming Chemistry More about me Linx Legal stuff History of this page Sign my guestbook View my guestbook Mail me |
Blackjack 1.5
Sign explanation and key location:
<> not equal [2ndF] [COMMAND] [C] [6]
% exponent [Exp]
# space (where there are several in a row) [ALPHA] [(-)]
! factorial [MATH] [A] [5]
[ matrix opening bracket [MATH] [E] [3]
] matrix closing bracket [MATH] [E] [4]
, comma [ALPHA] [.]
random random number generator [MATH] [A] [8]
int integer function [MATH] [A] [2]
{-} unary minus [(-)]
sqrt( square root function
NB Case is important outside of quotes!!! (to get uppercase [ALPHA] [2ndF] [letter])
Create a new program in matrix mode called "Blackjack" Print "####Blackjack Print "####By James Print "###Andrewartha Print "" Print "###Version 1.5 Print "##(c) 1997 All Print "#rights reserved Wait 7 ti=0 If J=10Goto l dim A[5,13] money=100 bet=5 Label sh ClrT highscore=H Print highscore Print "Shuffling Print "Please wait... z=0 a=1 Label sap b=1 Label sbp A[a,b]=4 b=b+1 If b<14Goto sbp a=a+1 If a<5Goto sap a=1 Label cl A[5,a]=0 a=a+1 If a<11Goto cl Label py If bet>moneyGoto bx ClrT Print money Print bet Print "1) Change bet Print "2) Deal Print "3) Save game Input choice If choice=1Goto chb If choice=2Goto dl If choice=3Goto s Goto py Label l z=A[5,11] bet=A[5,12] money=A[5,13] J=0 Goto py Label s A[5,11]=z A[5,12]=bet A[5,13]=money J=10 ClrT Print "Game saved End Label Bx bet=money Goto py Label chb Print "---Change-bet--- Print bet Input newbet If money<newbetGoto chb If newbet<=0Goto chb bet=newbet Goto py Label dl ClrT Print "Deal Gosub ccd A[5,1]=cd Gosub ccd A[5,2]=cd Gosub ccd A[5,6]=cd Gosub ccd A[5,7]=cd c=2 e=2 Label hp Gosub scd Gosub ct If d3=21Goto dbl If y3=21Goto ybl If y3>21Goto ybs If c=5Goto y5 Print "1) Hit Print "2) Pass choice=0 Input choice If choice=1Goto ht If choice=2Goto ps Goto hp Label ht c=c+1 Gosub ccd A[5,c]=cd yougot=cd Print yougot Wait 2 Goto hp Label ps Gosub ct Gosub scd If d3>21Goto dbs If d3=21Goto dbl If e=5Goto d5 If d3<17Goto dht If d1+d2=57Goto dht If y3>d3Goto yw If y3=d3Goto drw Goto dw Label dht e=e+1 Gosub ccd A[5,e+5]=cd hegot=cd Print hegot Wait 1 Goto ps Label drw Print "You drew with Print "the dealer. All Print "bets are off. Goto ag Label ybl If c=2Goto yb2 Print "You got 21 Goto yw Label dbl If d3=y3Goto drw Print "Dealer got 21 Goto dw Label ybs Print "You busted Goto dw Label dbs Print "Dealer busted Goto yw Label y5 Print "You got 5 cards Goto yw Label d5 Print "Deal got 5 cards Goto dw Label yb2 Print "###Blackjack! money=money+bet/2 Label yw Print "You win Print "Well done money=money+bet Goto ag Label dw Print "Dealer wins Print "Sucked in money=money-bet Label ag Wait ti If money>HGoto nh ti=8 If Z>149Goto sh a=1 If money>0Goto cl Print "You are out of Print "money. Piss off End Label nh H=money Print "" Print "You got a new###high score. Print "Well done! ti=5 Goto ag Label ccd st=int (4random )+1 cd=int (13random )+1 If A[st,cd]=0Goto ccd A[st,cd]=A[st,cd]-1 z=z+1 Return Label ct y1=0 y2=0 a=1 Label alp y=A[5,a] If y>10Goto fa If y=1Goto ac Goto elp Label fa y=10 Goto elp Label ac y2=50 Label elp y1=y1+y a=a+1 If a<6Goto alp d1=0 d2=0 Label blp d=A[5,a] If d>10Goto fb If D=1Goto bc Goto clp Label fb d=10 Goto clp Label bc d2=50 Label clp d1=d1+d a=a+1 If a<11Goto blp If y1>y2Goto y1g y3=y1+10 If y3<22Goto dg Label y1g y3=y1 Label dg If d1>d2Goto d1g d3=d1+10 If d3<22Goto rt Label d1g d3=d1 Label rt Return Label scd youhave=1%8A[5,5]+1%6A[5,4]+1%4A[5,3]+100A[5,2]+A[5,1] dealerhas=1%8A[5,10]+1%6A[5,9]+1%4A[5,8]+100A[5,7]+A[5,6] Print "---------------- Print youhave Print dealerhas Return |
| This space has been provided by Data Analysis Australia |
| Since 26/2/99, you are visitor number |
| Served by WebCounter |