Esempio n. 1
0
    static void Main(string[] args)
    {
        string[] inputs;

        // game loop
        while (true)
        {
            map = new Map();

            turnType = int.Parse(Console.ReadLine());
            for (int i = 0; i < 7; i++)
            {
                inputs = Console.ReadLine().Split(' ');
                for (int j = 0; j < 7; j++)
                {
                    string tile = inputs[j];
                    //Console.Error.WriteLine(tile);
                    map.add(new Point(j, i), new Tile(tile));
                }
            }

            players = new List <Player>();

            for (int i = 0; i < 2; i++)
            {
                inputs = Console.ReadLine().Split(' ');
                int    numPlayerCards = int.Parse(inputs[0]); // the total number of quests for a player (hidden and revealed)
                int    playerX        = int.Parse(inputs[1]);
                int    playerY        = int.Parse(inputs[2]);
                string playerTile     = inputs[3];

                players.Add(new Player(playerX, playerY, numPlayerCards, new Tile(playerTile)));
            }

            items = new List <Item>();

            int numItems = int.Parse(Console.ReadLine()); // the total number of items available on board and on player tiles
            for (int i = 0; i < numItems; i++)
            {
                inputs = Console.ReadLine().Split(' ');
                string itemName     = inputs[0];
                int    itemX        = int.Parse(inputs[1]);
                int    itemY        = int.Parse(inputs[2]);
                int    itemPlayerId = int.Parse(inputs[3]);

                items.Add(new Item(itemX, itemY, itemName, itemPlayerId));
                players[itemPlayerId].items.Add(items[i]);
            }

            int numQuests = int.Parse(Console.ReadLine()); // the total number of revealed quests for both players
            for (int i = 0; i < numQuests; i++)
            {
                inputs = Console.ReadLine().Split(' ');
                // Console.Error.WriteLine(inputs[0], inputs[1]);
                string questItemName = inputs[0];
                int    questPlayerId = int.Parse(inputs[1]);
                players[questPlayerId].quests.Add(questItemName);
            }

            players[0].setTargetList();
            players[1].setTargetList();

            players[0].opponent = players[1];
            players[1].opponent = players[0];

            map.backup();

            Simulate sim = new Simulate();

            Console.WriteLine(sim.bestMove());
        }
    }