Skip to content

Commit

Permalink
split pot if you share the same straight
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrs2002 committed Feb 15, 2024
1 parent 4fd63c2 commit 7063268
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/functionality.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,13 @@ function evaluateHand(iteration, gameStep) {
if (winningHand === 4) {/*determine who has the highest straight */
topHand = Math.max(...playerStraightHighCard);


if (getOccurrence(playerStraightHighCard, topHand) > 1 && playerStraightHighCard[0] === topHand) {
youWin("split");
showPlayersCards();
return false;
}

}
if (winningHand === 2) { /* If the 2 winning players have two pair, who has the best 2 pair?*/
let allPairs = [...plyr1Pair, ...plyr2Pair, ...plyr3Pair, ...plyr4Pair];
Expand Down

0 comments on commit 7063268

Please # to comment.