Hey I'm trying to use a 52 array to create a deck of cards. for each place in the array I'm assigning an int value which will correspond to a certain card.
100’s digit designate the suit (Hearts, Diamonds, Clubs, Spades), and the tens and ones digit designating the Rank (Ace, Two, Three, Four, … Jack, Queen, King).
For example:
101 = Ace of Hearts
102 = Two of Hearts
...
112 = Queen of Hearts
113 = King of Hearts
201 = Ace of Diamonds
202 = Two of Diamonds.
...
213 = King of Diamonds
301 = Ace of Clubs
302 = 2 of Clubs
..
313 = King of Clubs
401 = Ace of Spades
...
413 = King of Spades
So starting from place 0 in the array I assign the first value and so forth for the whole array. But when I created this function to assign the values I got back -858993460 as the value for each place in the array. I cant quite figure out what went wrong with my function or if their is an easier way to assign the values.
I'm not quite sure what you mean, I'm not returning anything I'm just trying to populate the array with the specific values. I rechecked the values and its actually working except every 13th card is showing that weird value.