Пример #1
0
 public Generator(int nbLabys, int width, int height, String fileName)
 {
     _nbLabyrinths = nbLabys;
     if (width % 2 == 0)
     {
         _width = width + 1;
     }
     else
     {
         _width = width + 2;
     }
     if (height % 2 == 0)
     {
         _height = height + 1;
     }
     else
     {
         _width = width + 2;
     }
     Laby = new Cell[_width, _height];
     for (int i = 0; i < _nbLabyrinths; i++)
     {
         GenBase();
         GenMaze();
         MazeFileName = "\\Zips\\" + fileName + i + ".txt";
         FilesZipOps.StringMaze(Laby, MazeFileName);
     }
     FilesZipOps.ZipMazes(fileName);
 }
Пример #2
0
        static void Main()
        {
            var maze  = new Generator(20, 20, "Maze1");
            var mazes = new Generator(5, 20, 20, "Mazes");
            var cons  = new ConsoleOut();

            cons.PrintMaze(maze.Laby);
            FilesZipOps.StringMaze(maze.Laby, maze.MazeFileName);
            Thread.Sleep(100000);
        }