Created
September 10, 2017 13:15
-
-
Save chunrapeepat/b72d3476ff6601f58d76d751cd730d8b to your computer and use it in GitHub Desktop.
ywc15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cardAt(n) { | |
const a = ['C', 'D', 'H', 'S'], | |
b = [2, 3, 4, 5, 6, 7, 8, 9, 0, 'J', 'Q', 'K', 'A'] | |
const c = Math.floor(n / b.length), | |
d = n - (b.length * c) | |
return b[d] + a[c] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment