Git Product home page Git Product logo

sudokusolver's Introduction

SudokuSolver

This program will solve a given sudoku using backtracking.

Running the executable

Passing the -v option will print out the solved board once found. You can pass any number of file arguments the program will solve all of them. Only files after the -v option will print their solution.

Example ./solver 9x9/* -v 12x12/puz1

This will solve every file in the 9x9 directory then solve puz1 in the 12x12 directory and print the solution of that puzzle. Every time the program will print the number of guesses and memory accesses. These accesses are how many squares we had to check to find the solution. The directory tells the program the size of the puzzle and the files specify the size of the blocks and puzzle.

File format

The first line needs to be the size of the blocks in the format height x width. For example a 9x9 has 3x3 blocks therefore the first line would be 3x3. A 12x12 sudoku has 3x4 blocks, which means the blocks are 3 deep and 4 wide. 0s are used to represent an empty square. For any puzzle higher than 9x9 I use capital letters to represent the next numbers. Therefore for a 12x12 each row, column, and block contain 1-9,A,B,C. These letters are changed to integers when solving and printing the subsequent result.

Make sure the letters are capital letters

When writing a new large sudoku use capital letters instead of lowercase!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.