Poker hand analyser: Difference between revisions

→‎Extra Credit Version: Fixed small bug. Added further example to test it.
(Adds Clojure solution)
(→‎Extra Credit Version: Fixed small bug. Added further example to test it.)
Line 1,289:
flush -> return "flush"
straight -> return "straight"
else -> return if (jokers == 0) "high-card" else "one-pair"
}
}
Line 1,310:
"🃏 🃍 🃟 🃁 🃊",
"🃏 🃂 🂢 🃟 🃍",
"🃏 🃂 🂢 🃍 🃍",
"🃂 🃞 🃍 🃁 🃊"
)
for (hand in hands) {
Line 1,333 ⟶ 1,334:
🃏 🃂 🂢 🃟 🃍 : four-of-a-kind
🃏 🃂 🂢 🃍 🃍 : invalid
🃂 🃞 🃍 🃁 🃊 : high-card
</pre>
 
9,492

edits