Ejemplo n.º 1
0
        public static PolarGrid CreatePolarGrid(int rows)
        {
            var grid = new PolarGrid(rows);

            grid.Init();

            return(grid);
        }
Ejemplo n.º 2
0
        private static void BuildPolar()
        {
            Console.WriteLine("Polar");

            var grid = PolarGrid.CreatePolarGrid(40);

            var mazeBuilder = new RecursiveBacktracker();

            mazeBuilder.Build(grid);

            var distances = Distances.Build(grid.GetCell(0, 0));

            var gd     = GridDisplayFactory.GetDisplayForGrid(grid);
            var bitmap = gd.MakeImage(distances);

            bitmap.Save("Polar.png", ImageFormat.Png);
            Console.WriteLine("Done");
        }
Ejemplo n.º 3
0
        static void PolarGrid(int size)
        {
            Random    random = new Random();
            int       seed   = random.Next(int.MinValue, int.MaxValue);
            PolarGrid grid   = new PolarGrid(size, seed);

            Houstons.CreateMaze <PolarGrid, PolarCell>(grid);
            Bitmap img  = grid.ToPNG(50);
            string name = "Maze.png";

            img.Save(name);

            Process process = new Process();

            process.StartInfo.FileName = name;
            process.Start();
            process.Close();
        }