Beispiel #1
0
        private static void UpdateCoordinates(string command, Ivo ivo, Evil evil)
        {
            var ivoCoordinates = command.Split(' ', StringSplitOptions.RemoveEmptyEntries)
                                 .Select(int.Parse).ToArray();

            ivo.UpdateCoordinates(ivoCoordinates[0], ivoCoordinates[1]);

            command = Console.ReadLine();

            var evilCoordinates = command.Split(' ', StringSplitOptions.RemoveEmptyEntries)
                                  .Select(int.Parse).ToArray();

            evil.UpdateCoordinates(evilCoordinates[0], evilCoordinates[1]);
        }
Beispiel #2
0
        private static void MoveIvo(Ivo ivo, int[,] matrix)
        {
            int n = matrix.GetLength(0);
            int m = matrix.GetLength(1);

            while (ivo.Row >= 0)
            {
                if (ivo.Row < n && ivo.Col >= 0 && ivo.Col < m)
                {
                    ivo.CollectPoints(matrix[ivo.Row, ivo.Col]);
                }

                ivo.UpdateCoordinates(ivo.Row - 1, ivo.Col + 1);
            }
        }