February 24th, 2009, 07:14 PM
Need help with homework program
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
Last edited by Sean123; February 24th, 2009 at 07:25 PM.
February 25th, 2009, 05:27 AM
Re: Need help with homework program
Rate the posts which you find useful
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!