News for hackers. Stuff that matters.

lovegraphs

Re:Show HN: Space Invaders built with React on Tuesday October 20, 2015 @01:48AM (#10417635)
Same on Chrome 45.0.2454.101, Ubuntu 14.04
Re:Maze Generator and Solver on Thursday May 28, 2015 @06:34PM (#9621626)
Thank you, sorry about that. I changed some references around and caught that error only after having deployed.
Re:Maze Generator and Solver on Wednesday May 27, 2015 @03:25AM (#9609855)
By the way, thank you for your colorful simile--it really spurred me to fix this issue this morning, and I've definitely learned to take cross-browser compatibility more seriously. Cheers.
Re:Maze Generator and Solver on Wednesday May 27, 2015 @02:41AM (#9609686)
Safari is fixed! I need to get a Macbook so testing is faster than waiting for a screenshot online...
Re:Maze Generator and Solver on Wednesday May 27, 2015 @02:40AM (#9609676)
Hey Vishal, thanks! Small world!
Re:Maze Generator and Solver on Tuesday May 26, 2015 @10:16AM (#9604976)
Thanks! It now works on iOS. Still working on Safari...
Re:Maze Generator and Solver on Tuesday May 26, 2015 @10:14AM (#9604962)
Thanks! Pull request merged.
Re:Maze Generator and Solver on Tuesday May 26, 2015 @10:12AM (#9604952)
Thanks! Removed.
Re:Maze Generator and Solver on Tuesday May 26, 2015 @04:32AM (#9603516)
Lamentable. Must be some missing cross-browser CSS.. I'll look into it tomorrow! In the meanwhile try it in Chrome if you have a chance :)
Re:Maze Generator and Solver on Tuesday May 26, 2015 @04:27AM (#9603504)
The particular generation algorithm that you see is called "Randomized Prim's algorithm" on Wikipedia. It starts at a random cell in a grid, marks it as discovered, and adds all of that cell's adjacent walls to a queue. It then selects a random wall from the queue and, if the cell on the other side of the wall has not yet been discovered, opens up that wall. It adds all of the adjacent cell's walls to the queue, marks the adjacent cell as discovered, and selects the next random wall in the queue until all the cells have been discovered. It's kind of a modified BFS. This algorithm guarantees that all cells are connected.
Re:Maze Generator and Solver on Tuesday May 26, 2015 @03:58AM (#9603433)
That's right, it does a breadth-first-search from the end-point immediately upon clicking the end-point; it then traces the path from the start-point, following the parent-pointers set during the BFS, painting the DOM in the process.
Re:Maze Generator and Solver on Tuesday May 26, 2015 @03:54AM (#9603423)
Thanks!