Example #1
0
        private static bool ValidCell(int x, int y, MatrixField matrix)
        {
            if (x >= 0 && x < matrix.GetLengthX() &&
                y >= 0 && y < matrix.GetLengthY())
            {
                return(true);
            }

            return(false);
        }
Example #2
0
        private static void InitializeMatrix(MatrixField matrix)
        {
            int value = 0;

            for (int i = 0; i < matrix.GetLengthX(); i++)
            {
                for (int j = 0; j < matrix.GetLengthY(); j++)
                {
                    matrix[i, j] = value++;
                }
            }
        }