↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Generating Mazes in a Browser

The post revisits the Mazes for Programmers project and explains a shift from a console app that opened bitmaps with shell execute to a browser-based version that is friendlier to macOS and Linux. It points readers to the GitHub repo and notes that the bitmaps are generated in memory and streamed to the browser.

Reading notes
#

  • The project is based on Mazes for Programmers by Jamis Buck, with the book’s Ruby samples rewritten in C#.
  • The earlier console approach used shell execute to show the maze bitmap, which worked on Windows but was not a good cross-platform solution.
  • The new MazeWeb project shows a parameter page in the browser.
  • The page lets the user choose maze size, color, and maze algorithm.
  • Example outputs are shown for 50, Purple, Recursive Backtracker and for 150, Mustard, Aldous-Broder.
  • Larger values take longer to generate, and the delay appears to come from bitmap creation rather than maze generation.
  • A large output image is mentioned as 4500x4500 and about 2 MB when saved.
  • The project uses .NET Core 3.1.
  • In Visual Studio 2019, MazeWeb must be set as the startup project and selected in the Start Debugging dropdown instead of IIS Express.
  • The site can also be run from the command line with dotnet run inside the MazeWeb folder.
  • The author says there is still work to do, including default values on the parameter page and possible inefficiencies in bitmap generation.