Long ago, when I used to code card games with usual playing cards, I used to specify a number for each card and call a function with some number to get a card. This somewhat inspired me to make this challenge.
So for the people unaware of the playing cards, a deck of cards consist of 52 cards (13 in each of the four suits, i.e, Hearts, Diamonds, Spades, Clubs). In each suit, there are 13 cards - firstly the cards numbered from 2-10, then the Jack(J), Queen(Q), King(K) and the Ace(A). This is the order
The challenge is to take an integer between 1-52 as input and display the card at that position. But, your output must be in words. Also, order must be maintained, i.e, first 13 cards will be of Hearts, then Diamonds, then Spades and finally Clubs.
For example, if someone chooses the number
30.The card would then belong to the third suit, i.e, the Spades. Also, it would be the fourth card in the suit, which means the number 5. Hence your output in words must be:
five of spades and it should always follow this format, i.e, first the card, followed by an
of and the name of the suit at the end, with required spaces in between.
Input And Output
The input will be an integer between 1-52 (both inclusive). Note that here counting starts from 1. You may choose to start from 0. However, you must maintain the order of the cards which is mentioned above. Your output should be the card at that position written in words. You do not need to handle invalid inputs. Also, your output may be in lower-case or in upper-case.
Given below is the list of all the possible inputs and their outputs:
1 -> two of hearts 2 -> three of hearts 3 -> four of hearts 4 -> five of hearts 5 -> six of hearts 6 -> seven of hearts 7 -> eight of hearts 8 -> nine of hearts 9 -> ten of hearts 10 -> jack of hearts 11 -> queen of hearts 12 -> king of hearts 13 -> ace of hearts 14 -> two of diamonds 15 -> three of diamonds 16 -> four of diamonds 17 -> five of diamonds 18 -> six of diamonds 19 -> seven of diamonds 20 -> eight of diamonds 21 -> nine of diamonds 22 -> ten of diamonds 23 -> jack of diamonds 24 -> queen of diamonds 25 -> king of diamonds 26 -> ace of diamonds 27 -> two of spades 28 -> three of spades 29 -> four of spades 30 -> five of spades 31 -> six of spades 32 -> seven of spades 33 -> eight of spades 34 -> nine of spades 35 -> ten of spades 36 -> jack of spades 37 -> queen of spades 38 -> king of spades 39 -> ace of spades 40 -> two of clubs 41 -> three of clubs 42 -> four of clubs 43 -> five of clubs 44 -> six of clubs 45 -> seven of clubs 46 -> eight of clubs 47 -> nine of clubs 48 -> ten of clubs 49 -> jack of clubs 50 -> queen of clubs 51 -> king of clubs 52 -> ace of clubs
This is code-golf, so the shortest code wins.