Esempio n. 1
0
        private static void RunExamples1()
        {
            var scan      = LoadState("example1.txt");
            var automaton = new Eris(scan);

            Console.WriteLine("EXAMPLE 1");
            Console.WriteLine("=========");
            Console.WriteLine();
            Console.WriteLine("Initial state:");
            PrintScan(automaton);
            Console.WriteLine();
            for (int i = 1; i < 5; i++)
            {
                automaton.Advance();
                Console.WriteLine("After " + i + " minute(s):");
                PrintScan(automaton);
                Console.WriteLine();
            }

            automaton = new Eris(scan);
            FindFirstRepeatedLayout(automaton);
            Console.WriteLine("First repeated layout:");
            PrintScan(automaton);
            Console.WriteLine();
            Console.WriteLine("Biodiversity rating: " + automaton.GetBiodiversityRating());
        }
Esempio n. 2
0
        private static void RunPuzzle1()
        {
            var scan      = LoadState("input.txt");
            var automaton = new Eris(scan);

            Console.WriteLine("PUZZLE 1");
            Console.WriteLine("========");
            FindFirstRepeatedLayout(automaton);
            Console.WriteLine("First repeated layout:");
            PrintScan(automaton);
            Console.WriteLine();
            Console.WriteLine("Biodiversity rating: " + automaton.GetBiodiversityRating());
        }