Partilhar via


Run Survo Solver inside browser using Web workers

In 2007 I started this blog with post Solving small puzzles (with just a few lines of code). Years later I noticed that there was actually comment at the blog post asking for the code of the app. Unfortunately, I’ve trashed that code so couldn’t get that back anymore. But I decided to implement it again and decided to add some extra flavor to it Smiley.

So I went and implemented survo solver using TypeScript + Javascript and Web workers which means that you can run it directly in your browser (actually I implemented this over a year ago but forgot to publish the blog post).

You can try the solver in here and check the source from here. Solver user interface looks like this:

Survo Solver user interface

In order to have lots of puzzles for my solvers I created puzzles.json data file. That file contains puzzles from https://www.survo.fi/puzzles/ and that local data file is used by the web worker solvers.

Hopefully this demo app gave you few ideas to think about. First: If you can run this kind of processing in browser (without any software installations) then what kind of things you can actually use this? Second: Browser performance is improving a lot as we speak and things like WebAssembly are also coming in the future. These two things in mind you can start building you own "distributed processing apps" Smiley. Maybe even apps like SETI@home running directly in the browser! And that would be pretty cool.

Anyways… Happy hacking!