예제 #1
0
 static void Main(string[] args)
 {
     for (var i = 1; i <= 10; i++)
     {
         if (i % 2 != 0)
         {
             while (true)
             {
                 Player_X.RowandCol();
                 if (Player_X.isUsed(rowOne, rowTwo, rowThree) == true)
                 {
                     break;
                 }
             }
             if (Player_X.DidWin(rowOne, rowTwo, rowThree) == true)
             {
                 break;
             }
             else
             {
                 Console.WriteLine($"{rowOne[0]}{rowOne[1]}{rowOne[2]}\n{rowTwo[0]}{rowTwo[1]}{rowTwo[2]}\n{rowThree[0]}{rowThree[1]}{rowThree[2]}");
                 continue;
             }
         }
         else
         {
             while (true)
             {
                 Player_Y.RowandCol();
                 if (Player_Y.isUsed(rowOne, rowTwo, rowThree) == true)
                 {
                     Console.WriteLine($"{rowOne[0]}{rowOne[1]}{rowOne[2]}\n{rowTwo[0]}{rowTwo[1]}{rowTwo[2]}\n{rowThree[0]}{rowThree[1]}{rowThree[2]}");
                     break;
                 }
             }
             if (Player_Y.DidWin(rowOne, rowTwo, rowThree) == true)
             {
                 Console.WriteLine($"{rowOne[0]}{rowOne[1]}{rowOne[2]}\n{rowTwo[0]}{rowTwo[1]}{rowTwo[2]}\n{rowThree[0]}{rowThree[1]}{rowThree[2]}");
                 break;
             }
             else
             {
                 continue;
             }
         }
     }
 }
예제 #2
0
 public static void RowandCol()
 {
     Player_X.FindRow();
     Player_X.FindCol();
     Console.WriteLine($"You are Player {Player_X.type}");
 }