Ok the program is supposed to deal 5 cards out to 4 players. I'm just beginning so try to keep that in mind when giving advice that things like 2D arrays which would be extremely useful in this scenario are not an option. So I first filled an array with 0-51 to make the deck. I then shuffled the deck and handed it out to the 4 players. Now I have some numbers printed out as cards in the players hand. I need to make it so those numbers are somehow changed to suits/and numbered cards. To do this I play to use card[n]/13 to give me 0,1,2,3 then each of those numbers will signify a suit. Then do (card[n]%13)+1 to determine what card it is...(1=ace, 11=Jack, 12 = Queen, 13 = King). The problem I am having is implementing this into the program. If someone could point me in the direction I would be very appreciative.
Question
Sean123
Ok the program is supposed to deal 5 cards out to 4 players. I'm just beginning so try to keep that in mind when giving advice that things like 2D arrays which would be extremely useful in this scenario are not an option. So I first filled an array with 0-51 to make the deck. I then shuffled the deck and handed it out to the 4 players. Now I have some numbers printed out as cards in the players hand. I need to make it so those numbers are somehow changed to suits/and numbered cards. To do this I play to use card[n]/13 to give me 0,1,2,3 then each of those numbers will signify a suit. Then do (card[n]%13)+1 to determine what card it is...(1=ace, 11=Jack, 12 = Queen, 13 = King). The problem I am having is implementing this into the program. If someone could point me in the direction I would be very appreciative.
This is the source http://www.seanhelp.pastebin.com/m2b2a34b6
Edited by Sean123Link to comment
Share on other sites
2 answers to this question
Recommended Posts