Show HN: Solve and generate mazes with JavaScript on HTML Canvas
21–30 of 33 posts
Re: Show HN: Solve and generate mazes with JavaScript on HTML Canvas
#22When the website loads, if I put in a large number such as 500 and hit the generate button, it does not clear the previous puzzle and overlays on top. Second click still shows it bit now its a but transparent. Third click removes it altogether. I tried to skim through the code but not sure what the cause is given that you create a new Maze every single time. It seems to be some sort of canvas rendering bug as if I clear the canvas [1] it seems to work.
Re: Show HN: Solve and generate mazes with JavaScript on HTML Canvas
#23I explored the test site and tried different maze sizes with values in the 50s, 70s, 110s, 150 (including odd numbers). Curiously, I found the maze could be visually divided into four Cartesian-like quadrants. Consistently the middle divider had only one gap, and other major quadrants also consistently have only one gap. So, when I wondered if BFS solution might be different if I ran it multiple times, I couldn't tel…
Re: Show HN: Solve and generate mazes with JavaScript on HTML Canvas
#24Bug Report: http://prntscr.com/mcyc1b When the website loads, if I put in a large number such as 500 and hit the generate button, it does not clear the previous puzzle and overlays on top. Second click still shows it bit now its a but transparent. Third click removes it altogether. I tried to skim through the code but not sure what the cause is given that you create a new Maze every single time. It seems to be some s…
Re: Show HN: Solve and generate mazes with JavaScript on HTML Canvas
#25Re: Show HN: Solve and generate mazes with JavaScript on HTML Canvas
#26I'm surprised it doesn't allow you to "draw" on it to solve the maze. That seems like an essential (and easy to add) feature.
Re: Show HN: Solve and generate mazes with JavaScript on HTML Canvas
#27Re: Show HN: Solve and generate mazes with JavaScript on HTML Canvas
#28https://bost.ocks.org/mike/algorithms/#maze-generation has some visualizations for various different maze generation algorithms.
Re: Show HN: Solve and generate mazes with JavaScript on HTML Canvas
#29https://bost.ocks.org/mike/algorithms/#maze-generation has some visualizations for various different maze generation algorithms.
Great link. Here's another good one. https://www.jamisbuck.org/mazes/
Re: Show HN: Solve and generate mazes with JavaScript on HTML Canvas
#30Bug Report: http://prntscr.com/mcyc1b When the website loads, if I put in a large number such as 500 and hit the generate button, it does not clear the previous puzzle and overlays on top. Second click still shows it bit now its a but transparent. Third click removes it altogether. I tried to skim through the code but not sure what the cause is given that you create a new Maze every single time. It seems to be some s…
Thanks a lot for the bug report! You're right - I was forgetting to clear the canvas on render. So I added ctx.clearRect(0, 0, WIDTH, HEIGHT); to the start of the render method.