Okay so I have a Black Jack program in development. When the user decides to "Stay", meaning they do not draw another card, it is the Ai Dealer's turn. Now based on one of its conditions, it draws itself a card, and that works. The card value and its suit are stored properly into their lists. However, when it comes to printing them, the program exits the loop after displaying the second card's value (but, because its the dealer, it says "CARD FACE DOWN" instead). This does not happen when it displays the users cards.
This is the code:
L+2→L Output(L,1,"DEALER HAND:") L+1→L 1→C 0→U 1→X While D+1>C If C=2 Then Output(L,1,"CARD FACE DOWN") If ⌊DEAL(C)≤10 Then ⌊DEAL(C)→I Else 10→I End 3→C Goto 99 End If ⌊DEAL(C)≤10 Then U+⌊DEAL(C)→U Output(L,1,⌊DEAL(C)) Else U+10→U If ⌊DEAL(C)=11 Then Output(L,1,"JACK") End If ⌊DEAL(C)=12 Then Output(L,1,"QUEEN") End If ⌊DEAL(C)=13 Then Output(L,1,"KING") End If ⌊DEAL(C)=14 Then U+1→U Output(L,1,"ACE") End End If ⌊SDEAL(C)=1 Then Output(L,7,"OF CLUBS") End If ⌊SDEAL(C)=2 Then Output(L,7,"OF DIAMONDS") End If ⌊SDEAL(C)=3 Then Output(L,7,"OF HEARTS") End If ⌊SDEAL(C)=4 Then Output(L,7,"OF SPADES") End C+1→C Lbl 99 L+X→L If L≥10 Then Output(10,1,"PRESS ENTER TO CONTINUE") Pause ClrHome Disp "YOUR TOTAL: " Output(1,13,T) Disp "DEALER HAND:" Disp "..." 4→L 2→X End End Output(L,1,"TOTAL: AT LEAST ") Output(L,17,U) If U+I>21 Then Return End If M=1 or T>21 and M=1 Then Goto 55 End Output(10,3,"1 - HIT 2 - STAY") 0→R Repeat R=92 or R=93 getKey→R End Return
Say D=4 and M=1, for example. The loop should not end until C is greater than or equal to 5 (D+1), but the program goes all the way down to return after C equals 2.
Any and all help appreciated!
Thanks in advance.