Advertisement
Guest User

Untitled

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