Blazor .net 5 Rock paper scissors - how to add best 2 out 3 rule


I have just finished a rock paper and scissors game using the following winning rules, how should I add a rule to allow players to play up to 3 rounds before deciding a winner

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace RockPaperScissors.Components
public class WinningRules
private readonly IList<(int, int, bool, bool, string)> winningRules =
new List<(int, int, bool, bool, string)>
(0,0, false, false, “You both select Rock, it’s tie”),
(0, 1, false, true, “Paper beats Rock, you lose”),
(0, 2, true, false, “Rock beats Scissors, you win”),
(1, 0, true, false, “Paper beats Rock, you win”),
(1, 1, false, false, “You both select Paper, it’s tie”),
(1, 2, false, true, “Scissors beats Paper, you lose”),
(2, 0, false, true, “Rock beats Scissors, you lose”),
(2, 1, true, false, “Scissors beats Paper, you win”),
(2, 2, false, false,“You both select Scissors, it’s tie”)

    public (int, int, bool, bool, string) this[int playerChoice, int computerChoice]
        => winningRules.Single(w => w.Item1 == playerChoice && w.Item2 == computerChoice);


Use a variable counter to count the rounds and make a while loop that stops when it reaches 3 (make sure to not make it an infinite loop).

hi i been trying this, not working still

while (playerScore < 4 && computerScore < 4) 
                    if (playerScore == 3)
                        Console.WriteLine("PLAYER WON!");

                    else if (computerScore == 3)
                        Console.WriteLine("Computer WON!");

You have to have something counter in your while loop that will force it to end.
Also, do you really only want to end when both the scores are 4, or only 1?

so the idea is to pick a winner best of 3 or 5 rounds