Esempio n. 1
0
        static void Main(string[] args)
        {
            var magicSquareGenerator = new MagicSquareGenerator();
            var magicSquare          = magicSquareGenerator.Generate(3);

            Console.WriteLine(magicSquare);
            Console.ReadKey();
        }
        static void Main(string[] args)
        {
            //works best with 3
            //for 4, it take a minute or two
            //for 5 and above you have to wait for a long time
            MagicSquareGenerator magicSquareGenerator = new MagicSquareGenerator();
            var magic = magicSquareGenerator.Generate(3);

            foreach (var row in magic)
            {
                foreach (int i in row)
                {
                    Console.Write($"{i} ");
                }

                Console.WriteLine();
            }
        }