Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const N = gets();
- const royalCards = {11:'J',12:'Q',13:'K',14:'A'}
- const end = +N || {J:11, Q:12, K:13,A:14}[N];
- function draw(end){
- end>2 && draw(end-1);
- const card = royalCards[end] ? royalCards[end] : end;
- print(`${card} of spades, ${card} of clubs, ${card} of hearts, ${card} of diamonds`);
- };
- draw(end);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement