3 ms·
I doubt it’s supposed to, it’s to calculate who wins when writing your own poker implementation. I am not the author, but calculating the winner is non trivial.
by Bnshsysjab 6y ago
I doubt it’s supposed to, it’s to calculate who wins when writing your own poker implementation. I am not the author, but calculating the winner is non trivial.
- exdsq 6y agoIs it not? The win criteria is well specified so just iterate downwards from the highest priority win until you find a match?
- Bnshsysjab 6y agoSure, but that gets complicated when comparing two matching hands (flush vs flush, 2 pair vs 2pair). It’s more than a 50 line problem to solve.
- 40four 6y agoI had the same initial reaction as the other person. Should be easy right? I think you’re right though, there are probably many more steps to getting this right than it seems on the surface. I kind of want to take your 50 line challenge however :) I always loved playing poker, might be a fun exercise.
- exdsq 6y agoOkay fair it’s more than 50 lines, I guess my definition of non-trivial is something you can’t quickly think of a design for. I’ll try it later and see if there’s some gotchas I can’t think of :)