コード例 #1
0
 public void Play()
 {
     while (Player1Deck.Any() && Player2Deck.Any())
     {
         Move();
     }
 }
コード例 #2
0
        public void PlayRecursive()
        {
            HashSet <string> previous = new();

            while (Player1Deck.Any() && Player2Deck.Any())
            {
                var state = GetState();
                if (previous.Contains(state))
                {
                    Player2Deck.Clear();
                    break;
                }
                else
                {
                    previous.Add(state);
                }
                MoveRecursive();
            }
        }