Giter Club home page Giter Club logo

sugoku's Introduction

sugoku

Build Status Go Report Card Coverage Quality Gate Status

sugoku is a basic Sudoku solver, written in Golang.

It takes a raw input string representing a sudoku grid (where 0 means empty) and tries to solve it using a simple backtracking algorithm. The idea was not to make it as efficient as possible, but just to play a bit with Golang features.

Such inputs can be found on many sites, among others here.

Example

Below is an example demonstrating how the solver works.

Raw input

004300209005009001070060043006002087190007400050083000600000105003508690042910300

Initial board

_ _ 4 3 _ _ 2 _ 9
_ _ 5 _ _ 9 _ _ 1
_ 7 _ _ 6 _ _ 4 3
_ _ 6 _ _ 2 _ 8 7
1 9 _ _ _ 7 4 _ _
_ 5 _ _ 8 3 _ _ _
6 _ _ _ _ _ 1 _ 5
_ _ 3 5 _ 8 6 9 _
_ 4 2 9 1 _ 3 _ _

Solution

8 6 4 3 7 1 2 5 9
3 2 5 8 4 9 7 6 1
9 7 1 2 6 5 8 4 3
4 3 6 1 9 2 5 8 7
1 9 8 6 5 7 4 3 2
2 5 7 4 8 3 9 1 6
6 8 9 7 3 4 1 2 5
7 1 3 5 2 8 6 9 4
5 4 2 9 1 6 3 7 8

sugoku's People

Contributors

teemoo7 avatar

Watchers

 avatar

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.