[go: up one dir, main page]

Skip to content

Commit

Permalink
not sure why it ties
Browse files Browse the repository at this point in the history
  • Loading branch information
barakplasma committed Oct 8, 2020
1 parent fa6f20d commit fe924c6
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pokerHands/pokerhands.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,18 @@ PokerHand.prototype.rankHand = function() {

PokerHand.prototype.compareWith = function(hand){
let comparison = this.rankHand() - hand.rankHand();
if (comparison == 0) return Result.tie;
if (comparison == 0) {
// for (let i in this.value) {
// let curIndex = 4-parseInt(i);
// if (this.value[curIndex] !== hand.value[curIndex]) {
// if (this.compareCards(this.value[curIndex], hand.value[curIndex]) > 0) {
// return Result.win
// }
// return Result.loss
// }
// }
return Result.tie
};
if (comparison > 0) return Result.win;
if (comparison < 0) return Result.loss
}
Expand Down

0 comments on commit fe924c6

Please sign in to comment.