'*********************************************************** '* Name : BLACKJACK.BAS * '* Author : David Yates / Rich Hauck / Lamar Hines * '* Date 10 22 2004 * '* : All Rights Reserved * '*********************************************************** ' DECLARE AND INITIALIZE HARDWARE OBJECTS AND VARIABLES **** '*********************************************************** define OSC 4 'set the clock speed INCLUDE "modedefs.bas" buttonNewGame VAR PORTB.6 'SNS1AB buttonHitPlayer VAR PORTD.1 'SNS2AB buttonPlayerStayHitDealer VAR PORTD.0 'SNS3AB buttonDoubleDown VAR PORTC.2 'SNS4AB buttonBid5 VAR PORTB.1 'SNS2AB buttonBid10 VAR PORTB.2 'SNS2AB buttonBid25 VAR PORTB.3 'SNS2AB buttonBid50 VAR PORTB.4 'SNS2AB 'testGrn1 VAR PORTB.6 'Creates variable for test light i VAR BYTE 'set all the defaults for the LCD DEFINE LCD_DREG PORTC 'set the LCD Data Ports DEFINE LCD_DBIT 4 'set starting data bit 'PORT.C4(dataLine11),C.5(12),C.6(13),C.7(14) DEFINE LCD_RSREG PORTD 'Set LCD Register select 'Green wire DEFINE LCD_RSBIT 2 'Set Register select bit 'PORTD.2 DEFINE LCD_EREG PORTD 'Set LCD enable port 'white wire DEFINE LCD_EBIT 3 'Set LCD Enable bit 'PORTD.3 DEFINE LCD_BITS 4 'Set the bus size (4 or 8) 'Number of pins used on LCD DEFINE LCD_LINES 2 'Set the number of lines on the lcd DEFINE LCD_COMMANDUS 2000 'Set command delay in US DEFINE LCD_DATAUS 50 'Set datqa delay time in US 'The following are being defined as output for data pins 'You must use the last four pins of a data port when using last four data lines OUTPUT PORTC.4 'data line 11 (reflects starting bit refered to in LCD_DBit4 which is PortC.4) OUTPUT PORTC.5 'data line 12 OUTPUT PORTC.6 'data line 13 OUTPUT PORTC.7 'data line 14 INPUT buttonNewGame OUTPUT buttonHitPlayer ' set these 2 to output until new game subroutine completed OUTPUT buttonPlayerStayHitDealer OUTPUT buttonBid5 OUTPUT buttonBid10 OUTPUT buttonBid25 OUTPUT buttonBid50 'OUTPUT buttonDoubleDown betInput VAR WORD ' Create variable to store result TRISA = %11111111 ' Set PORTA to all input ADCON1 = %10000010 ' Set PORTA analog and right justify result Pause 500 ' Wait .5 second ADCIN 0, betInput ' Read channel 0 to adval bid VAR BYTE bid = betInput / 100 '*********************************************************** ' DECLARE AND INITIALIZE GAME OBJECTS AND VARIABLES ******** '*********************************************************** counter var byte counter = 0 ' CARD DECK AND RETURNED CARD VALUE cards VAR byte[13] cards(0) = 11 cards(1) = 2 cards(2) = 3 cards(3) = 4 cards(4) = 5 cards(5) = 6 cards(6) = 7 cards(7) = 8 cards(8) = 9 cards(9) = 10 cards(10) = 10 cards(11) = 10 cards(12) = 10 cardsFace VAR word[13] cardsFace(0) = "A" cardsFace(1) = "2" cardsFace(2) = "3" cardsFace(3) = "4" cardsFace(4) = "5" cardsFace(5) = "6" cardsFace(6) = "7" cardsFace(7) = "8" cardsFace(8) = "9" cardsFace(9) = "X" cardsFace(10) = "J" cardsFace(11) = "Q" cardsFace(12) = "K" TRISA = 255 ' Set PORTA to all input ADCON1 = 2 ' PORTA is analog randomCard var byte randomCard = 0 randomCardValue var byte randomCardValue = 0 randomFaceCardValue var byte randomFaceCardValue = 0 ' DEALER AND PLAYERS j VAR BYTE j = 0 dealerCards VAR byte[5] dealerCards(0) = 0 dealerCards(1) = 0 dealerCards(2) = 0 dealerCards(3) = 0 dealerCards(4) = 0 dealerHiddenCard var byte dealerHiddenCard = 0 dealerTotal var byte dealerTotal = 0 dealerCardTotal var byte dealerCardTotal = 0 dealerFaceCards VAR byte[5] dealerFaceCards(0) = " " dealerFaceCards(1) = " " dealerFaceCards(2) = " " dealerFaceCards(3) = " " dealerFaceCards(4) = " " l VAR BYTE l = 0 playerCards1 VAR byte[5] playerCards1(0) = 0 playerCards1(1) = 0 playerCards1(2) = 0 playerCards1(3) = 0 playerCards1(4) = 0 playerTotal1 var byte playerTotal1 = 0 playerCardTotal1 var byte playerCardTotal1 = 0 playerCashTotal1 var byte playerCashTotal1 = 100 playerWinTotal1 var byte playerWinTotal1 = 0 playerBidCurrent1 var byte playerBidCurrent1 = 0 playerFaceCards1 VAR byte[5] playerFaceCards1(0) = " " playerFaceCards1(1) = " " playerFaceCards1(2) = " " playerFaceCards1(3) = " " playerFaceCards1(4) = " " m VAR BYTE m = 0 playerCards2 VAR byte[5] playerCards2(0) = 0 playerCards2(1) = 0 playerCards2(2) = 0 playerCards2(3) = 0 playerCards2(4) = 0 playerTotal2 var byte playerTotal2 = 0 playerCardTotal2 var byte playerCardTotal2 = 0 playerWinTotal2 var byte playerWinTotal2 = 10 playerBidCurrent2 var byte playerBidCurrent2 = 0 '********************************************************** ' MAIN METHOD AND SUBROUTINES ***************************** '********************************************************** LCDOUT $FE, 1, " Blackjack-in-the-Box " 'write dealer and player total to screen LCDOUT $FE, $C0, " Press 'new game' button to start " 'write dealer and player total to screen main: ' *** BEGIN NEW GAME IF (buttonNewGame == 1) THEN GOSUB newGame ENDIF ' *** HIT PLAYER IF (buttonHitPlayer == 1) THEN GOSUB hitPlayer1 GOSUB writeDealerHiddenCard 'CHECK FOR THE ACE IF (playerTotal1 > 21) THEN p var byte FOR p=0 to 4 if (playerCards1(p)==11) then playerCards1(p)=1 endif playerTotal1=playerCards1(0)+playerCards1(1)+playerCards1(2)+playerCards1(3)+playerCards1(4) next p endif IF (playerTotal1 > 21) THEN GOSUB writeScore GOSUB dealerWins ENDIF IF (playerTotal1 == 21) or (playerCardTotal1 == 5) THEN GOSUB writeScore GOSUB playerWins ENDIF ENDIF ' *** HIT DEALER IF (buttonPlayerStayHitDealer == 1) THEN IF (dealerTotal < 17) THEN ' get 3rd dealer card GOSUB playerStayHitDealer GOSUB writeScore IF (dealerTotal < 17) THEN ' get 4th dealer card GOSUB playerStayHitDealer GOSUB writeScore IF (dealerTotal < 17) THEN ' get 5th dealer card GOSUB playerStayHitDealer GOSUB writeScore IF (dealerTotal < 17) THEN ' get 6th dealer card GOSUB playerStayHitDealer GOSUB writeScore ENDIF ENDIF ENDIF ENDIF 'CHECK FOR THE ACE IF (dealerTotal > 21) then d var byte FOR d=0 to 4 if (dealerCards(d)==11) then dealerCards(d)=1 endif dealerTotal=dealerCards(0)+dealerCards(1)+dealerCards(2)+dealerCards(3)+dealerCards(4) next d endif IF (dealerTotal > 21) or (dealerTotal < playerTotal1) THEN GOSUB playerWins ENDIF IF (dealerTotal > playerTotal1) and (dealerTotal <= 21) THEN GOSUB dealerWins ENDif IF (dealerTotal == playerTotal1) THEN GOSUB push ENDIF ENDIF ' *** DOUBLE DOWN IF (buttonDoubleDown == 1) THEN playerBidCurrent1 = playerBidCurrent1 * 2 gosub waitForBid GOSUB hitPlayer1 ENDIF GOTO MAIN '******************************************************************** ' SUBROUTINE NEW GAME *********************************************** newGame: outPUT buttonNewGame outPUT buttonHitPlayer outPUT buttonPlayerStayHitDealer if (playerCashTotal1 < 5) then gosub gameOverMoneyGone endif LCDOUT $FE, 1, "Starting new hand" PAUSE 2000 LCDOUT $FE, 1, "You have $", #playerCashTotal1 LCDOUT $FE, $C0, "Place your bet!" PAUSE 2000 counter = 1 gosub enableBidding while counter == 1 gosub waitForBid wend gosub disableBidding LCDOUT $FE, 1, "You've bet $", #playerBidCurrent1 pause 2500 j = 0 l = 0 m = 0 dealerCardTotal = 0 dealerTotal = 0 dealerHiddenCard = 0 dealerFaceCards(0) = " " dealerFaceCards(1) = " " dealerFaceCards(2) = " " dealerFaceCards(3) = " " dealerFaceCards(4) = " " playerCardTotal1 = 0 playerTotal1 = 0 playerTotal2 = 0 playerWinTotal1 = 0 playerWinTotal2 = 0 playerFaceCards1(0) = " " playerFaceCards1(1) = " " playerFaceCards1(2) = " " playerFaceCards1(3) = " " playerFaceCards1(4) = " " GOSUB hitPlayer1 GOSUB playerStayHitDealer GOSUB hitPlayer1 IF (playerTotal1 == 21) THEN GOSUB writeScore GOSUB playerWins endif GOSUB playerStayHitDealer IF (dealerTotal == 21) THEN GOSUB writeScore GOSUB dealerWins ENDIF GOSUB writeDealerHiddenCard INPUT buttonHitPlayer INPUT buttonPlayerStayHitDealer RETURN '******************************************************************** ' ENABLE BIDDING **************************************************** enableBidding: if (playerCashTotal1 >= 5) then INPUT buttonBid5 counter = 1 endif if (playerCashTotal1 >= 10) then INPUT buttonBid10 counter = 1 endif if (playerCashTotal1 >= 25) then INPUT buttonBid25 counter = 1 endif if (playerCashTotal1 >= 50) then INPUT buttonBid50 counter = 1 endif return '******************************************************************** ' WAIT FOR BID ****************************************************** waitForBid: playerBidCurrent1 = 0 IF (buttonBid5 == 1) THEN playerBidCurrent1 = playerBidCurrent1 + 5 counter = 2 output buttonBid5 ENDIF IF (buttonBid10 == 1) THEN playerBidCurrent1 = playerBidCurrent1 + 10 counter = 2 output buttonBid10 ENDIF IF (buttonBid25 == 1) THEN playerBidCurrent1 = playerBidCurrent1 + 25 counter = 2 output buttonBid25 ENDIF IF (buttonBid50 == 1) THEN playerBidCurrent1 = playerBidCurrent1 + 50 counter = 2 output buttonBid50 ENDIF return '******************************************************************** ' DISABLE BIDDING *************************************************** disableBidding: output buttonBid5 output buttonBid10 output buttonBid25 output buttonBid50 return '******************************************************************** ' DEAL CARD ********************************************************* dealCard: PAUSE 1000 ADCIN 0, randomCard ' Read noise from channel 0 to randomCard randomCard = randomCard // 13 'narrow value to random number from 0 to 13 randomCardValue = cards(randomCard)'assign value randomFaceCardValue = CardsFace(randomCard)'assign face to display return '******************************************************************** ' SUBROUTINE HIT PLAYER ********************************************* hitPlayer1: if (playerCardTotal1<2) then LCDOUT $FE, 1, "Dealing to Player" else LCDOUT $FE, 1, "Player Hits" endif gosub dealCard playerTotal1 = playerTotal1 + randomCardValue'add card value to player total playerCardTotal1 = playerCardTotal1 + 1 'add to number of cards in player's hand playerCards1(l)= randomCardValue playerFaceCards1(l)= randomFaceCardValue l = l + 1'increment array place RETURN '******************************************************************** ' SUBROUTINE PLAYER STAY / HIT DEALER ******************************* playerStayHitDealer: if (dealerCardTotal<2) then LCDOUT $FE, 1, "Dealing to Dealer" else LCDOUT $FE, 1, "Dealer Hits" endif gosub dealCard dealerTotal = dealerTotal + randomCardValue dealerCardTotal = dealerCardTotal + 1 dealerCards(j)= randomCardValue dealerFaceCards(j)= randomFaceCardValue j = j + 1 RETURN '******************************************************************** ' SUBROUTINE DEALER WINS ******************************************** dealerWins: playerWinTotal1 = playerWinTotal1 - playerBidCurrent1 playerCashTotal1 = playerCashTotal1 - playerBidCurrent1 LCDOUT $FE, 1, "Dealer Wins! ", #dealerTotal, ", ", #playerTotal1 LCDOUT $FE, $C0, "You now have $", #playerCashTotal1 PAUSE 2000 GOSUB gameOver RETURN '******************************************************************** ' SUBROUTINE PLAYER WINS ******************************************** playerWins: playerWinTotal1 = playerWinTotal1 + playerBidCurrent1 playerCashTotal1 = playerCashTotal1 + playerBidCurrent1 LCDOUT $FE, 1, "Player Wins! ", #dealerTotal, ", ", #playerTotal1 LCDOUT $FE, $C0, "You now have $", #playerCashTotal1 PAUSE 2000 GOSUB gameOver RETURN '******************************************************************** ' SUBROUTINE PUSH *************************************************** push: LCDOUT $FE, 1, "Push!" PAUSE 2000 GOSUB gameOver RETURN '******************************************************************** ' SUBROUTINE GAME OVER, MONEY GONE ********************************** gameOverMoneyGone: LCDOUT $FE, 1, "You're broke!" pause 2000 LCDOUT $FE, 1, " Blackjack-in-the-Box " 'write dealer and player total to screen LCDOUT $FE, $C0, " Press 'new game' button to start " 'write dealer and player total to screen playerCashTotal1=100 goto main return '******************************************************************** ' SUBROUTINE GAME OVER ********************************************** gameOver: INPUT buttonNewGame OUTPUT buttonHitPlayer OUTPUT buttonPlayerStayHitDealer GOSUB writeScore GOSUB writeGameOver GOSUB writeScore GOSUB writeGameOver GOSUB writeScore GOSUB newGame return '******************************************************************** ' SUBROUTINE WRITE GAME OVER **************************************** writeGameOver: LCDOUT $FE, 1, "Game Over" pause 750 return '******************************************************************** ' SUBROUTINE WRITE DEALER HIDDEN CARD ******************************* writeDealerHiddenCard: if (dealerCardTotal == 2) and (playerCardTotal1 == 2) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1) 'write dealer and player total to screen endif if (dealerCardTotal == 2) and (playerCardTotal1 == 3) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2) 'write dealer and player total to screen endif if (dealerCardTotal == 2) and (playerCardTotal1 == 4) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3) 'write dealerand player total to screen endif if (dealerCardTotal == 2) and (playerCardTotal1 == 5) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3),",",playerFaceCards1(4) 'write dealer and player total to screen endif if (dealerCardTotal == 3) and (playerCardTotal1 == 2) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1) 'write dealer and player total to screen endif if (dealerCardTotal == 3) and (playerCardTotal1 == 3) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2) 'write dealer and player total to screen endif if (dealerCardTotal == 3) and (playerCardTotal1 == 4) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3) 'write dealer and player total to screen endif if (dealerCardTotal == 3) and (playerCardTotal1 == 5) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3),",",playerFaceCards1(4) 'write dealer and player total to screen endif if (dealerCardTotal == 4) and (playerCardTotal1 == 2) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2),",", dealerFaceCards(3) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1) 'write dealer and player total to screen endif if (dealerCardTotal == 4) and (playerCardTotal1 == 3) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2),",", dealerFaceCards(3) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2) 'write dealer and player total to screen endif if (dealerCardTotal == 4) and (playerCardTotal1 == 4) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2),",", dealerFaceCards(3) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3) 'write dealerand player total to screen endif if (dealerCardTotal == 4) and (playerCardTotal1 == 5) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2),",", dealerFaceCards(3) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3),",",playerFaceCards1(4) 'write dealer and player total to screen endif if (dealerCardTotal == 5) and (playerCardTotal1 == 2) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2),",", dealerFaceCards(3), ",", dealerFaceCards(4) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1) 'write dealer and player total to screen endif if (dealerCardTotal == 5) and (playerCardTotal1 == 3) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2),",", dealerFaceCards(3), ",", dealerFaceCards(4) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2) 'write dealer and player total to screen endif if (dealerCardTotal == 5) and (playerCardTotal1 == 4) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2),",", dealerFaceCards(3), ",", dealerFaceCards(4) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3) 'write dealer and player total to screen endif if (dealerCardTotal == 5) and (playerCardTotal1 ==! 5) then LCDOUT $FE, 1, "Dealer:X,", dealerFaceCards(1), ",", dealerFaceCards(2),",", dealerFaceCards(3), ",", dealerFaceCards(4) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3),",",playerFaceCards1(4) 'write dealer and player total to screen endif pause 1000 return '******************************************************************** ' SUBROUTINE WRITE SCORE ******************************************** writeScore: if (dealerCardTotal == 2) and (playerCardTotal1 == 2) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1) 'write dealer and player total to screen endif if (dealerCardTotal == 2) and (playerCardTotal1 == 3) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2) 'write dealer and player total to screen endif if (dealerCardTotal == 2) and (playerCardTotal1 == 4) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3) 'write dealerand playertotal to screen endif if (dealerCardTotal == 2) and (playerCardTotal1 == 5) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3),",",playerFaceCards1(4) 'write dealer and player total to screen endif if (dealerCardTotal == 3) and (playerCardTotal1 == 2) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1) 'write dealer and player total to screen endif if (dealerCardTotal == 3) and (playerCardTotal1 == 3) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2) 'write dealer and player total to screen endif if (dealerCardTotal == 3) and (playerCardTotal1 == 4) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3) 'write dealerand player total to screen endif if (dealerCardTotal == 3) and (playerCardTotal1 == 5) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3),",",playerFaceCards1(4) 'write dealer and player total to screen endif if (dealerCardTotal == 4) and (playerCardTotal1 == 2) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2), ",", dealerFaceCards(3) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1) 'write dealer and player total to screen endif if (dealerCardTotal == 4) and (playerCardTotal1 == 3) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2), ",", dealerFaceCards(3) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2) 'write dealer and player total to screen endif if (dealerCardTotal == 4) and (playerCardTotal1 == 4) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2), ",", dealerFaceCards(3) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3) 'write dealerand player total to screen endif if (dealerCardTotal == 4) and (playerCardTotal1 == 5) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2), ",", dealerFaceCards(3) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3),",",playerFaceCards1(4) 'write dealer and player total to screen endif if (dealerCardTotal == 5) and (playerCardTotal1 == 2) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2), ",", dealerFaceCards(3), ",",dealerFaceCards(4) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1) 'write dealer and player total to screen endif if (dealerCardTotal == 5) and (playerCardTotal1 == 3) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2), ",", dealerFaceCards(3), ",",dealerFaceCards(4) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2) 'write dealer and player total to screen endif if (dealerCardTotal == 5) and (playerCardTotal1 == 4) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2), ",", dealerFaceCards(3), ",",dealerFaceCards(4) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3) 'write dealer and player total to screen endif if (dealerCardTotal == 5) and (playerCardTotal1 == 5) then LCDOUT $FE, 1, "Dealer:", dealerFaceCards(0), ",", dealerFaceCards(1),",", dealerFaceCards(2), ",", dealerFaceCards(3), ",",dealerFaceCards(4) LCDOUT $FE, $C0, "Player:", playerFaceCards1(0), ",", playerFaceCards1(1),",", playerFaceCards1(2), ",", playerFaceCards1(3),",",playerFaceCards1(4) 'write dealer and player total to screen endif pause 1000 return