Maze Algorithms (2011)
11–20 of 24 posts
Re: Maze Algorithms (2011)
#12This might be a stupid question but how can the site run multiple maze generation algorithm at the same time? My understanding is that javascript is single thread.
Re: Maze Algorithms (2011)
#13This might be a stupid question but how can the site run multiple maze generation algorithm at the same time? My understanding is that javascript is single thread.
I peeked at the javascript and it looks like when you hit `run`, it is calling the step at a setInterval (if I'm reading this right, as fast as the browser can call run)
So at the end of each run call, the interpreter figures out which setInterval timer to execute next and has the chance to pick other mazes. (I don't know much about how the JS engine resolves which "not quite thread" gets run next when there are multiple candidates)
Re: Maze Algorithms (2011)
#14The Aldous-Broder algorithm sure is somethin'.
Re: Maze Algorithms (2011)
#15This might be a stupid question but how can the site run multiple maze generation algorithm at the same time? My understanding is that javascript is single thread.
Really good question actually! I peeked at the javascript and it looks like when you hit `run`, it is calling the step at a setInterval (if I'm reading this right, as fast as the browser can call run) So at the end of each run call, the interpreter figures out which setInterval timer to execute next and has the chance to pick other mazes. (I don't know much about how the JS engine resolves which "not quite thread" ge…