goldfire / pokersolver

Javascript poker hand solver.
MIT License
373 stars 93 forks source link

can you predict the output for the below example ? as per the documentation it should give two winners. However, giving me only one winner and that too precedence of the player in the array passed. #10

Closed PreethamRU closed 6 years ago

PreethamRU commented 7 years ago
var hand1 = Hand.solve(['Ad', '2s', '9h', '4d', '5h']);
hand1.name = 'preetham';
console.log('hand1 ==>'+hand1.name); // Two Pair 
console.log('hand1 ==> '+hand1.descr);

var hand2 = Hand.solve(['Ad', 'As', 'Jc', '3h', '2d']);
hand2.name='rocker';
console.log('hand2 ==> '+hand2.name); // Two Pair 
console.log('hand2 ==>'+hand2.descr);

var hand3 = Hand.solve(['Ah', 'Ac', 'Jd', '3c', '2f']);
hand3.name='Baxish';
console.log('hand2 ==> '+hand3.name); // Two Pair 
console.log('hand2 ==>'+hand3.descr);

var winner = Hand.winners([hand1, hand3,hand2]);
console.log(winner[0].name)
goldfire commented 6 years ago

When I run that it gives me two winners and seems to be working correctly. Your console.log at the end is only logging the first winner.