• Example

    // should return player1 (the winner)
    rockpaperscissors(2, 1)

    Example

    // should return tie (it's a tie)
    rockpaperscissors(1, 1)

    Description

    Main function, you need to pass 2 numbers.

    Returns

    either "player1", "player2" (whoever won) or "tie" for a tie.

    Parameters

    • player1: number

      1 for rock, 2 for paper, 3 for scissors

    • player2: number

      1 for rock, 2 for paper, 3 for scissors

    Returns string

Generated using TypeDoc