Example #1
0
        static void Main()
        {
            byte[,] board = new byte[3, 3];
            for (int i = 0; i < 3; i++)
            {
                string line = Console.ReadLine();
                for (int j = 0; j < 3; j++)
                {
                    if (line[j] == '-')
                    {
                        board[i, j] = TicTakToePrediction.EmptyCell;
                    }
                    else if (line[j] == 'X')
                    {
                        board[i, j] = TicTakToePrediction.PlayerX;
                    }
                    else if (line[j] == 'O')
                    {
                        board[i, j] = TicTakToePrediction.PlayerO;
                    }
                }
            }
            //Stopwatch sw = new Stopwatch();
            //sw.Start();
            TicTakToePrediction predictor = new TicTakToePrediction(board);

            predictor.Predict();
            Console.WriteLine(predictor.playerXWins);
            Console.WriteLine(predictor.evenGames);
            Console.WriteLine(predictor.playerOWins);
            //sw.Stop();
            //Console.WriteLine(sw.Elapsed);
        }
Example #2
0
 static void Main()
 {
     byte[,] board = new byte[3, 3];
     for (int i = 0; i < 3; i++)
     {
         string line = Console.ReadLine();
         for (int j = 0; j < 3; j++)
         {
             if (line[j] == '-') board[i, j] = TicTakToePrediction.EmptyCell;
             else if (line[j] == 'X') board[i, j] = TicTakToePrediction.PlayerX;
             else if (line[j] == 'O') board[i, j] = TicTakToePrediction.PlayerO;
         }
     }
     //Stopwatch sw = new Stopwatch();
     //sw.Start();
     TicTakToePrediction predictor = new TicTakToePrediction(board);
     predictor.Predict();
     Console.WriteLine(predictor.playerXWins);
     Console.WriteLine(predictor.evenGames);
     Console.WriteLine(predictor.playerOWins);
     //sw.Stop();
     //Console.WriteLine(sw.Elapsed);
 }