Jun 27, 2018 - If you are just here for the code and explanation, jump to the The Initial. To use Microsoft Word and Excel — I genuinely had no idea what code was. The code isn't perfect, but it will solve pretty much any Sudoku puzzle.
Introduction Last months I solve one medium difficult Sudoku on a daily base to keep my cognitive abilities in shape. Now last week I caught a cold and fell ill. Instead of boring myself at home I thought, 'Lets make a Sudoku Solver in MS-Excel'. Below is the result. Follow the instructions below and have fun. Maybe you'll learn something!
Disclaimer * The VBA-code is free of virusses, including my flu-virus, which is sad, since I would like to share that with the whole community. * The Sudoku Solver should solve all easy and medium level Sudokus. * It should solve many of the difficult level Sudokus as well. * The Sudoku Solver could only solve Sudokus with one single sollution! * One solving sollution mechanism is lacking, because that is way complex to program.
Maybe next year, when I fell ill, I will program it. I will illustrate the lacking mechanism with an example. If two squares only could contain 4s and 8s the other seven squares couldn't contain those values. Simular mechanisms could theoretically also exist in combinations of 3 or more. If someone sees the challenge to program it.
Go ahead and make my day! * If you are stuck with finding a sollution, trial and error in the Solver-grid to come to the right sollution. Eventually you should restart a few times. * It should be easy to handle the Sudoku Solver. * Feel free to adjust the Sudoku Solver. Instruction * Font of the whole sheet is Arial.
* Cell A1: 'Sudoku Solver', 18pt, Bold * Cell A2: 'Author: Harmonica', 11pt, Italic * Cell A3: 'Date: 4 November 2017', 11pt, Italic * Cell B7: 'Sudoku', 14pt, Bold * Cell L7: 'Solver', 14pt, Bold * Cell L20: 'Round:', 11pt Italic * Cell N20: '(0=Reset)', 11pt * Cell L21: 'Note:', 11pt * Cell M20: 11pt * Cell M21: 11pt * Cells B9-J17: 16pt, Bold with borders * Cells B39-J47: 16pt, Bold with borders * Cells L9-T17: 10pt, Bold with borders * Columns B-J: Width=4 * Columns L-T: Width=10 * Copy-Paste the VBA-Code to a VBA Module. It won't work otherwise. The easiest way to create a module is to Record a Macro, Type Some Text and Stop the Recording. * In Excel you need to activate the Developers tab. * Create below the Sudoku 5 Buttons with the captions 'Solve One Round', 'Save Sudoku', 'Restore Sudoku', 'Random Value' and 'Clear Sudoku', 12pt, Bold.
* Apply the right Macro to the right Button. Download acpi x64 based pc motherboard manual free online. * Save your work and try it. Have you tried the Skyscrapers or Sumscrapers puzzles? They're similar--still fitting one of each digit in each row and column--but use a different mechanism than the 3x3 square to constrain the problem. They provide the same type of enjoyment--hunting for that one move that you have enough information to deduce, which then opens up another move, etc.--but I often prefer them. There are good examples of both (and many other types of logic puzzles) in the app '100 Logic Games' by Andrea Sabbatini. I know it's available for iOS.not sure about other platforms.
Excel Sudoku Solver Description This program will solve (most) standard sudoku puzzles. I say 'most' instead of 'all' because this version of the solver relies on logic-only solving. If 'brute force' (that is, guessing) is ever required, the solver will get stuck. I do not consider that a disadvantage.
I developed this program as part of creating the website, which was my first 'modern' venture into cyberspace. Thus the built-in hyperlink. The version available at that website is protected to prevent accidental destruction of working parts. This version is not, so if you happen to enjoy reading code, you can have a look. Potential Improvements A previous iteration of this program which relied much more on string manipulation in Excel itself did have one nice feature that this one lacks: the ability to add just one more value as a hint, if you happen to be stuck. Of course the trade off was a speed factor of about 4, so there you have it.
I suppose if there was a public clamour for it, I would also add a 'brute force' option box so that it could solve each and every valid sudoku puzzle. Another Solver sent along this version of a sudoku solver, which is also a logic-only solver, and has a hints feature and a load of other buttons.
It's a more muscular program than mine, for sure, more code, faster solve, more complete logic. Makes me jealous and now I have to fix mine up some. Comments Have comments about this program?