I'm having trouble creating a String that will allow my numbers in a 5 Hand Poker Assignment turn into words. The numbers are from 1 to 52, represent each card in the deck. Ace of Spades in 1, 2 of Spades is 2... 14 is Ace of Clubs... 27 is Ace of Diamonds... and 40 is Ace of Hearts, etc. I want to print out the number to their according card. What is the code for this?
Asked
Active
Viewed 68 times
-3
-
Please show what you have tried. – merlin2011 May 30 '14 at 02:12
-
1What programming language are you using ? – Walle Cyril May 30 '14 at 02:14
1 Answers
0
Define an array/list
cards=["Ace of Spade", "Two of Spade, ... ]
2.Create string
String = cards[number]
3 Do it again for all cards and print result

Walle Cyril
- 3,087
- 4
- 23
- 55