Created
April 27, 2020 22:03
-
-
Save v1vendi/aecdd1df576b5c08233bfb2d82957658 to your computer and use it in GitHub Desktop.
generate poker hands table
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
var values = Array.from('AKQJT98765432') | |
// values.map(j => `${values[Math.min(i,j)]}${values[Math.max(i,j)]}${i > j ? 's' : i < j ? 'o' : ''}`).join(', ') | |
var result = values.map( | |
(_,i) => values.map( | |
(_,j) => `${values[Math.min(i,j)]}${values[Math.max(i,j)]}${i > j ? 's' : i < j ? 'o' : ''}`.padEnd(4) | |
).join('') | |
).join('\n') | |
console.log(result) | |
/* | |
AA AKo AQo AJo ATo A9o A8o A7o A6o A5o A4o A3o A2o | |
AKs KK KQo KJo KTo K9o K8o K7o K6o K5o K4o K3o K2o | |
AQs KQs QQ QJo QTo Q9o Q8o Q7o Q6o Q5o Q4o Q3o Q2o | |
AJs KJs QJs JJ JTo J9o J8o J7o J6o J5o J4o J3o J2o | |
ATs KTs QTs JTs TT T9o T8o T7o T6o T5o T4o T3o T2o | |
A9s K9s Q9s J9s T9s 99 98o 97o 96o 95o 94o 93o 92o | |
A8s K8s Q8s J8s T8s 98s 88 87o 86o 85o 84o 83o 82o | |
A7s K7s Q7s J7s T7s 97s 87s 77 76o 75o 74o 73o 72o | |
A6s K6s Q6s J6s T6s 96s 86s 76s 66 65o 64o 63o 62o | |
A5s K5s Q5s J5s T5s 95s 85s 75s 65s 55 54o 53o 52o | |
A4s K4s Q4s J4s T4s 94s 84s 74s 64s 54s 44 43o 42o | |
A3s K3s Q3s J3s T3s 93s 83s 73s 63s 53s 43s 33 32o | |
A2s K2s Q2s J2s T2s 92s 82s 72s 62s 52s 42s 32s 22 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment