static void Main(string[] args) { int width = int.Parse(Console.ReadLine()); // the number of cells on the X axis int height = int.Parse(Console.ReadLine()); // the number of cells on the Y axis Game game = new Game(width, height); for (int i = 0; i < height; i++) { string line = Console.ReadLine(); // width characters, each either 0 or . for (int j = 0; j < line.Length; j++) if (line[j] != '.') { int links = int.Parse(line[j].ToString()); game.AddNode(j, i, links); } } // Write an action using Console.WriteLine() // To debug: Console.Error.WriteLine("Debug messages..."); game.BuildNeighbors(); game.Solve(); //Console.WriteLine("0 0 1 0 0 1"); // Three coordinates: a node, its right neighbor, its bottom neighbor }