I have finished everything except the rules and a thing where it ask
if you want to play.Comment if you have a comment.
Also,ways to win-
get 21
get 5 cards without going over 21
if dealer busts then you win
there is dealer advantage in this game(just like james bond blackjack on ps1)
EDIT
i had to add
if bet<0
goto deal
endif
so you can't bet a neg number lol
Blackjack:
RANDOMIZE TIMER()
sync on :`<erase
set text font "courier"
set text size 25
set cursor 575,383
gold=100
Deal:
cls
set cursor 575,383
text 160,290, "GOLD:"+str$(gold)
text 200,380, "How much would you like to bet>"
input bet
if bet<0
goto deal
endif
if bet>gold
text 200,400, " You don't have enough gold"
gosub mouse
goto deal
endif
gold=gold-bet
mpress=1
stand=0
c(3)=0:c(4)=0:c(5)=0
Dc(3)=0:Dc(4)=0:Dc(5)=0
dim card$(14)
dim cardv(14)
card$(1)="2":cardv(1)=2
card$(2)="3":cardv(2)=3
card$(3)="4":cardv(3)=4
card$(4)="5":cardv(4)=5
card$(5)="6":cardv(5)=6
card$(6)="7":cardv(6)=7
card$(7)="8":cardv(7)=8
card$(8)="9":cardv(8)=9
card$(9)="10":cardv(9)=10
card$(10)="J":cardv(10)=10
card$(11)="Q":cardv(11)=10
card$(12)="K":cardv(12)=10
card$(13)="A":cardv(13)=11
card$(14)="A":cardv(14)=1
dim c(5)
dim Dc(5)
c(1)=rnd(12)+1
c(2)=rnd(12)+1
Dc(1)=rnd(12)+1
Dc(2)=rnd(12)+1
Start:
WHILE forever=0
mx=mousex()
my=mousey()
hand=cardv(c(1))+cardv(c(2))+cardv(c(3))+cardv(c(4))+cardv(c(5))
Dhand=cardv(Dc(1))+cardv(Dc(2))+cardv(Dc(3))+cardv(Dc(4))+cardv(Dc(5))
cls
gosub check
text 160,290, "GOLD:"+str$(gold)
text 260,400, card$(c(1))+" "+card$(c(2))+" "+card$(c(3))+" "+card$(c(4))+" "+card$(c(5))
text 260,350, "? "+card$(Dc(2))
text 193,400, "Hand>"
text 250,440, "[HIT] [STAND]"
if mouseclick()=0 then mpress=0
if mouseclick()=1 and mpress=0
mpress=1
if mx>=255 and mx<=306 and my>=444 and my<=459
if c(3)=0
c(3)=rnd(12)+1
goto start
endif
if c(4)=0
c(4)=rnd(12)+1
goto start
endif
if c(5)=0
c(5)=rnd(12)+1
goto start
endif
endif
if mx>=327 and mx<=401 and my>=444 and my<=459
exit
endif
endif
sync
ENDWHILE
Start2:
WHILE forever=0
Dhand=cardv(Dc(1))+cardv(Dc(2))+cardv(Dc(3))+cardv(Dc(4))+cardv(Dc(5))
cls
gosub check
text 160,290, "GOLD:"+str$(gold)
text 260,400, card$(c(1))+" "+card$(c(2))+" "+card$(c(3))+" "+card$(c(4))+" "+card$(c(5))
text 260,350, card$(Dc(1))+" "+card$(Dc(2))+" "+card$(Dc(3))+" "+card$(Dc(4))+" "+card$(Dc(5))
if hand>Dhand
sleep rnd(500)+1500
if Dc(3)=0
Dc(3)=rnd(12)+1
goto start2
endif
if Dc(4)=0
Dc(4)=rnd(12)+1
goto start2
endif
if Dc(5)=0
Dc(5)=rnd(12)+1
goto start2
endif
endif
if hand<=Dhand
stand=1
endif
sync
ENDWHILE
goto skip
````````````````````````````
Check:
if dhand=21
text 250,250, "21 DEALER WINS!"
gosub lose
endif
if hand=21
text 250,250, " 21 YOU WIN!"
gosub win
endif
if Dhand>21
for a=1 to 5
if Dc(a)=13 then Dc(a)=14:goto start2
next a
cls
text 250,250, "DEALER BUSTED"
text 250,270, " YOU WIN!"
gosub win
endif
if hand>21
for a=1 to 5
if c(a)=13 then c(a)=14:goto start
next a
text 250,250, " YOU BUSTED"
text 250,270, "DEALER WINS!"
gosub lose
endif
if c(5)>0 and hand<21
text 250,250, " YOU WIN!"
text 250,270, " 5 CARDS"
gosub win
endif
if Dc(5)>0 and Dhand<21
text 250,250, "DEALER WINS!"
text 250,270, " 5 CARDS"
gosub lose
endif
if stand=1
if Dhand=hand
text 255,250, " PUSH"
gosub push
endif
if Dhand>hand
text 250,250, "DEALER WINS!"
gosub lose
endif
endif
Return
Lose:
text 260,400, card$(c(1))+" "+card$(c(2))+" "+card$(c(3))+" "+card$(c(4))+" "+card$(c(5))
text 260,350, card$(Dc(1))+" "+card$(Dc(2))+" "+card$(Dc(3))+" "+card$(Dc(4))+" "+card$(Dc(5))
text 160,290, "GOLD:"+str$(gold)
gosub mouse
goto deal
Return
Win:
text 260,400, card$(c(1))+" "+card$(c(2))+" "+card$(c(3))+" "+card$(c(4))+" "+card$(c(5))
text 260,350, card$(Dc(1))+" "+card$(Dc(2))+" "+card$(Dc(3))+" "+card$(Dc(4))+" "+card$(Dc(5))
gold=gold+2*bet
text 160,290, "GOLD:"+str$(gold)
gosub mouse
goto deal
Return
Push:
text 260,400, card$(c(1))+" "+card$(c(2))+" "+card$(c(3))+" "+card$(c(4))+" "+card$(c(5))
text 260,350, card$(Dc(1))+" "+card$(Dc(2))+" "+card$(Dc(3))+" "+card$(Dc(4))+" "+card$(Dc(5))
gold=gold+bet
text 160,290, "GOLD:"+str$(gold)
gosub mouse
goto deal
Return
mouse:
press=1
While forever=0
if mouseclick()=0 then press=0
if mouseclick()=1 and press=0 then exit
sync
ENDwhile
return
````````````````````````````
Skip:
Return
If at first you don't succeed-Pause-Go to last checkpoint