HOME | DD

FlyingHyrax — Rainmeter Sudoku Solver by-nc-sa

Published: 2013-12-12 16:25:28 +0000 UTC; Views: 15473; Favourites: 26; Downloads: 1201
Redirect to original
Description This skin solves Sudoku puzzles using my Lua implementation of Peter Norvig's Python solving algorithm .
It doesn't really have any practical purpose - if you actually like Sudoku, then you'll solve puzzles by hand; and if you're actually trying to crack Sudokus algorithmically, then you'll probably write your own solver (and Rainmeter is not the best medium).  I just wrote it as a personal exercise.  It should solve any valid Sudoku grid - though if you don't give it enough constraints (clues) then it will only provide one of multiple possible solutions.

The coolest script feature is a "bullet time" mode - when it's on, the Lua script will update the skin every time the algorithm assigns a value to a cell, so you can watch the program solve the puzzle in slow motion.  For example, here's a .gif showing the skin solving Arto Inkala's 2010 puzzle .  It can be turned on and off by using the skin's context menu.

How to:
  • Left-click a cell to show a digit chooser for that cell
  • Right-click the chooser to dismiss it
  • Right-click a filled cell to clear it
  • Scroll up/down on a cell to increment/decrement its value
Once you've entered your clues, just hit "solve."  "Clear grid" does exactly what it says on the tin.  In the context menu, you can toggle the slow motion effect and switch the skin between light and dark versions.  Note that both context menu actions require the skin to refresh, so if you first fill in the grid, then use the context menu, the grid will be cleared.  Also, this skin requires the latest release version of Rainmeter 3.0
Related content
Comments: 9

balazslaci [2014-01-08 19:41:13 +0000 UTC]

Hi,

I'm working on a Sudoku Rainmeter skin (a game, not a solver). The skin is ready, but now I'd like to add a solver lua script, which could solve the grid, on a button click. I found your Sudoku solver skin and found it interesting, but despite I'm working by a few days onto it, I can't modify your lua script to match my purposes. So, I'm asking you, if you can and have time, to assist me onto this.

Thank you

👍: 0 ⏩: 1

FlyingHyrax In reply to balazslaci [2014-01-09 14:59:45 +0000 UTC]

Absolutely!  Sounds like fun.    Do you have a forum thread or something where I can check out your code?

👍: 0 ⏩: 1

balazslaci In reply to FlyingHyrax [2014-01-09 21:10:17 +0000 UTC]

No, I haven't started one yet, but I could send it via email or upload it to Filefactory or other filehost service. As I wrote, in fact the skin is ready, I'd like to add just this solver lua script. I've created another solver lua script but it can't solve just some puzzle, not all of them. So, please let me know how can I send the skin. My email address: blaci75@gmail.com

👍: 0 ⏩: 1

FlyingHyrax In reply to balazslaci [2014-01-09 22:08:40 +0000 UTC]

Either works for me - I don't have a preference.    I sent you an email so you have my address.

👍: 0 ⏩: 0

jadawgis732 [2013-12-30 05:59:16 +0000 UTC]

This is a nice dev. Is that the optimal algorithm? I though Simplex, had the best runtime. It looks pretty nasty to apply to Sudoku though.

👍: 0 ⏩: 1

FlyingHyrax In reply to jadawgis732 [2014-01-01 16:22:40 +0000 UTC]

There are undoubtedly faster or more general purpose algorithms - but most of those are either beyond my current comprehension level  (and I like to be able to understand what I write...) or are more difficult to implement then the marginal performance improvement they would yield is worth.  If you want the details on how this algorithm works, I'd highly recommend Norvig's original essay: norvig.com/sudoku.html

👍: 0 ⏩: 0

yking1997 [2013-12-19 08:24:13 +0000 UTC]

I like this,thank you!

👍: 0 ⏩: 0

randomenemy321 [2013-12-13 20:50:35 +0000 UTC]

Thanks a great little tool nice work  


Will be using it to check them quicker

👍: 0 ⏩: 0

ionstorm01 [2013-12-12 21:33:34 +0000 UTC]

Nice skin my friend!  Thanks!

👍: 0 ⏩: 0