Card game problem
Balvamar
Member, PRO Posts: 117
I am working on a poker card game at the moment.
The problem I am having is that I am using indexes from 0-51 for the playing cards.
I have everything working for all hands except hands that involve the ace being the high card.
I have used mod(cardIndex,13) to represent the card values.
I have used a bubble sort algorithm to sort the cards that have been selected.
Example.... A royal flush would be A K Q J 10 of the same suit. The problem is that viewed as values
it would be 0 9 10 11 12.
If anyone has had a similar problem I would appreciate a bit of help. Cheers
Comments
Not sure but if like slots you can't use a 0 as a chose item. Why is your ace not a 1? Maybe I'm missing something. Are your cards not as 1-52?
Complete Guide to iOS Publishing {} Complete Guide to Mac Publishing
I know that when I started the project I was using 1-52, but I changed it to 0-51 because I wanted to use the mod 13, and that did not work well with 1-52....at least I think this was the reason I have sorted the problem now, however it is fairly complicated. Im sure there is a better and simpler way, but I'm just not experienced enough as a programmer yet to see it.
Did you figure out how to get them to deal to the players? I have been working on a texas hold em project. I have it set up to flip the cards one at a time when the deck is clicked, however i cannot figure out how to do it without touch having to be pressed.
Use a timer, for example, or a loop?
In any case, if you have a question about a project of yours, open a new thread, this one is over two years old.
@grayneweddie This thread is two and a half years old. I recommend starting a new thread and explaining what you're trying to do. You can always reference this thread.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Ok thank you guys for the advice.