Beispiel #1
0
    static void Main(string[] args)
    {
        int id        = int.Parse(Console.ReadLine()); // id of your player.
        int boardSize = int.Parse(Console.ReadLine());

        Console.Error.WriteLine("ID " + id + " size " + boardSize);

        // game loop
        while (true)
        {
            // rows from top to bottom (viewer perspective)
            var lines = new List <string> ();
            for (int i = 0; i < boardSize; i++)
            {
                string line = Console.ReadLine();
                Console.Error.WriteLine(line);
                lines.Add(line);
            }
            // number of legal actions for this turn
            var actions     = new List <string> ();
            int actionCount = int.Parse(Console.ReadLine());
            for (int i = 0; i < actionCount; i++)
            {
                // the action
                string action = Console.ReadLine();
                Console.Error.WriteLine(action);
                actions.Add(action);
            }
            Console.Error.WriteLine("-----");

            // a-h1-8
            //string bestAction = actions.OrderByDescending(a => evaluateMove(a)).First();
            //Console.WriteLine(bestAction);
            //
            Othello o    = new Othello(lines.ToArray());
            string  move = o.PlayNextMove(id);

            //
            Console.WriteLine(move);
        }
    }