SirChick Posted December 9, 2007 Share Posted December 9, 2007 Was wondering about casino games with php how do you make it so that if a play is dealt a card say 10 of clubs.... the script will know that it is not physically possibly to deal another 10 of clubs? Do you make an array of all the cards and take out that value from it or something ? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 9, 2007 Share Posted December 9, 2007 That's what I would do. Quote Link to comment Share on other sites More sharing options...
SirChick Posted December 9, 2007 Author Share Posted December 9, 2007 Ok thankyou. Quote Link to comment Share on other sites More sharing options...
Crew-Portal Posted December 9, 2007 Share Posted December 9, 2007 Heres all the card names just to help you out so you dont gotta write em' Im making a blackjack game in Visual Basic so you will need to Translate it itnto PHP but here ya go... Private Enum CardNames AceOfSpades TwoOfSpades ThreeOfSpades FourOfSpades FiveOfSpades SixOfSpades SevenOfSpades EightOfSpades NineOfSpades TenOfSpades JackOfSpades QueenOfSpades KingOfSpades AceOfDiamonds TwoOfDiamonds ThreeOfDiamonds FourOfDiamonds FiveOfDiamonds SixOfDiamonds SevenOfDiamonds EightOfDiamonds NineOfDiamonds TenOfDiamonds JackOfDiamonds QueenOfDiamonds KingOfDiamonds AceOfClubs TwoOfClubs ThreeOfClubs FourOfClubs FiveOfClubs SixOfClubs SevenOfClubs EightOfClubs NineOfClubs TenOfClubs JackOfClubs QueenOfClubs KingOfClubs AceOfHearts TwoOfHearts ThreeOfHearts FourOfHearts FiveOfHearts SixOfHearts SevenOfHearts EightOfHearts NineOfHearts TenOfHearts JackOfHearts QueenOfHearts KingOfHearts End Enum Quote Link to comment Share on other sites More sharing options...
SirChick Posted December 9, 2007 Author Share Posted December 9, 2007 Is that an array in VB then ? never seen End Enum in PHP before.. thanks for the list by the way much appreciated! Quote Link to comment Share on other sites More sharing options...
revraz Posted December 9, 2007 Share Posted December 9, 2007 Yes, thats VB and not PHP. But it's easy to copy/paste that list and use it. Quote Link to comment Share on other sites More sharing options...
Crew-Portal Posted December 10, 2007 Share Posted December 10, 2007 It even says its VB in the beginning of the post. Heres all the card names just to help you out so you dont gotta write em' Im making a blackjack game in Visual Basic so you will need to Translate it itnto PHP but here ya go... Quote Link to comment Share on other sites More sharing options...
kratsg Posted December 10, 2007 Share Posted December 10, 2007 Here's my suggestion: Two arrays: one array contains all the cards in the deck (from which you randomly pick a card). one array contains all the cards that are currently in play, or have been played. if(in_array($cards_played,$card_drawn)){//uh-oh, we've already played this card! //re-draw, w/e } else { $cards_played[] = $card_drawn;//auto-add to end //proceed with script, etc... } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.