News for hackers. Stuff that matters.

davidim

What sort of drawing are you thinking? Dragging the mouse around on the screen or navigating with the arrows?
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.
Recursive division may be elegant, but it seems that may also have its disadvantages.
Thanks so much for the compliment. This is probably a bi-product of the maze generation algorithm I used. Essentially, at every step, the algorithm bisects the maze horizontally or vertically - then, it chooses a random cell along this bisection to leave open (that way the 2 resulting regions are still connected). Then, the same algorithm is performed on the 2 new regions. Recursion continues until it no longer makes sense to continue bisecting.

Wikipedia has an article on maze generation that explains the algorithm - https://en.m.wikipedia.org/wiki/Maze_generation_algorithm

Thanks for checking it out! I am wondering how big is the number you are putting in? If the number is really high, it's probably causing a stack overflow. I would limit the size, but each browser has its own recursion limits so that would be quite a pain. In retrospect, I probably should not have used a recursive algorithm for this task :).
Re:Show HN: An analog clock on html canvas on Monday December 31, 2018 @09:49PM (#18798608)
Thanks for checking it out. I like the idea of making the hand move between seconds - I was actually thinking about doing something like that when originally making the clock - then I got too lazy and told myself that real clocks don’t do that so I don’t have to worry about implementing it :). Now it’s too late! I haven’t looked at the code for 2 days, and there are no comments! :)

I’m not sure what you mean with that last suggestion - I’m pretty sure you’re joking, but I still have no idea what you’re talking about.