示例#1
0
        public long SolveA(string input)
        {
            var spots  = new Spots(input);
            int rowNum = -1;

            foreach (var row in spots.Rows)
            {
                rowNum++;
                int colNum = -1;
                foreach (var spot in row)
                {
                    colNum++;
                    switch (spot)
                    {
                    case Spot.Wall:
                        continue;

                    case Spot.Space:
                        continue;

                    case Spot.Goblin:
                        // Choose the closest spot that's reachable, empty, and adjacent to an Elf.
                        // Move one spot towards that spot.
                        spots.MoveTowardsEnemy(new Coords(rowNum, colNum));

                        // Attack the weakest adjacent Elf.
                        //spots.Attack(new Coords(rowNum, colNum));

                        break;

                    case Spot.Elf:
                        // Move one spot towards a reachable, empty spot adjacent to a Goblin.

                        // Attack the weakest Goblin.
                        break;
                    }
                }
            }


            return(0);
        }