Beispiel #1
0
        public void segundoTestGeneracionEtapa2()
        {
            ConwayCanvas conway = new ConwayCanvas();


            File.Rle  testmatrix = new File.Rle("Patterns/3enginecordership.rle");
            bool[][]  matrix     = testmatrix.GetMatrix();
            Cuadrante test       = Cuadrante.crear(matrix);


            test = test.expandir();
            for (int i = 0; i < 50; i++)
            {
                test = test.expandir();
                test = test.generacion();
            }
        }
Beispiel #2
0
        public static void segundoTestGeneracionEtapa4()
        {
            ConwayCanvas conway = new ConwayCanvas();

            File.Rle  testmatrix  = new File.Rle(@"Patterns/gosperglidergun.rle");
            bool[][]  matrix      = testmatrix.GetMatrix();
            Cuadrante test        = Cuadrante.crear(matrix);
            double    iteraciones = 0;
            var       sw          = Stopwatch.StartNew();

            for (int i = 0; i < 3; i++)
            {
                while (!(test.getCuadranteCentral().isCentrado() && test.isCentrado()))
                {
                    test = test.expandir();
                }
                iteraciones += (long)Math.Pow(2, test.nivel - 2);
                test         = test.generacionEtapa4();
            }
            sw.Stop();
        }