# blackjackView *PL '
'
*PL 'Dealer'
if ARGS[0] = 0:
*P '> src="<<$deckImg[dealerHand[0]]>>">'
*PL '> src="images/locations/city/industrial/casino/cards/back.jpg">'
else
numAces = 0
dealerPoints = 0
i = 0
:loop1
*P '> src="<<$deckImg[dealerHand[i]]>>">'
if deckFace[dealerHand[i]] = 1:
dealerPoints += 11
numAces += 1
elseif deckFace[dealerHand[i]] > 9:
dealerPoints += 10
else
dealerPoints += deckFace[dealerHand[i]]
end
i += 1
if dealerHand[i] ! 0: jump 'loop1'
:loop2
if dealerPoints > 21 and numAces > 0:
dealerPoints -= 10
numAces -= 1
jump 'loop2'
end
if dealerPoints > 21:
*P ' BUST!' elseif dealerPoints = 21 and dealerHand[2] = 0: *P ' BLACKJACK!' else *P ' < Player' i = 0 :loop3 numAces = 0 playerPoints[i] = 0 if numHands > 1: *PL 'Hand #<>:' j = 0 :loop4 if playerHand[i * 16 + j] ! 0: *P '> src="<<$deckImg[playerHand[i * 16 + j]]>>">' if deckFace[playerHand[i * 16 + j]] = 1: playerPoints[i] += 11 numAces += 1 elseif deckFace[playerHand[i * 16 + j]] > 9: playerPoints[i] += 10 else playerPoints[i] += deckFace[playerHand[i * 16 + j]] end j += 1 jump 'loop4' end :loop5 if playerPoints[i] > 21 and numAces > 0: playerPoints[i] -= 10 numAces -= 1 jump 'loop5' end if playerPoints[i] > 21: *P ' BUST!' elseif playerPoints[i] = 21 and playerHand[2] = 0 and numHands = 1: *P ' BLACKJACK!' else *P ' < ' i += 1 if i < numHands: jump 'loop3' *PL ' | > src="images/locations/city/industrial/casino/cartbd.jpg"> |