Hey there, just asking how I could implement a scoring system to add up the totals of the player and dealer to see who has the highest number for a game of blackjack. Currently not started on the computer controlled dealer but just wondering how I woul add the total value of the cards together while using cards.dll
Iv added in some value but I believe that my calculation is way off and I just cant seem to get my head around it.
Im wanting it to add the two random cards dealt to the player from the deck so that
player total = random card 1 + random card 2
and then to add on to this each time I click the hit command
Last card game I did, I indexed the cards to allow easy comparison and value manipulations. The system I used was that a card's index was the number of the card, ie. 1 = Duece, 13 = Ace, multiplied by ten, plus the number of the suit (according to precidence.) So, assuming the precidence of suits was Spades - Hearts - Diamonds - Clubs, the 2 of Clubs would be 11, the King of Hearts would be 123, the Ace of Spaces would be 134, etc. That let me do direct comparisons for value based on the index of the card, either including suit precedence or not. To compare (or add) a value, just take the integer of the card index divided by 10 for 'suitless' comparisons, and the index itself for 'suited' comparisons. I actually used numeric representations of the cards in code, and when drawing them or naming them just called a translation function. I'm not familiar with cards.dll so I don't know how it functions, but it appears that it is just displaying cards for you, and it would be up to you to keep track of the values. Hope this helped more than it confused.
So i need to give each cards its own number?. Im not to sure how to go about doing this and what the calculation would involve. If i could add and index value to the cards I could figure it out easy enough. Does anyone know how I would index the cards or will I have to create a whole new array and come up with the image files myself?