Skip to content

four-of-a-kind is missing in highestRank() #13

@vasyl-shumskyi

Description

@vasyl-shumskyi

Looks like four-of-a-kind is missing in the highestRank() function

var highestRank = function (hand) {
    var result = "bust"; // default is bust

    if (containsRoyalFlush(hand)) {
        result = "royal flush";
    } else if (containsStraightFlush(hand)) {
        result = "straight flush";
    } else if (containsFullHouse(hand)) {
        result = "full house";
    } else if (containsFlush(hand)) {
        result = "flush";
    } else if (containsStraight(hand)) {
        result = "straight";
    } else if (containsThreeOfAKind(hand)) {
        result = "three of a kind";
    } else if (containsTwoPair(hand)) {
        result = "two pair";
    } else if (containsPair(hand)) {
        result = "pair";
    }

    return result;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions