GitXplorerGitXplorer
b

sudokude

public
12 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
4fe357e01aa2ba9fe165f8b05d8edb8203238ce3

fixed sudoku puzzle in readme

bbioball committed 11 years ago
Unverified
b3b6be88a388c5e2a65b3d56f85dd034279a0887

Revised readme

bbioball committed 11 years ago
Unverified
0dc64c30c98951cb3a986f9f00c3bc20fd2b770b

Merge remote-tracking branch 'origin/master'

bbioball committed 11 years ago
Unverified
c2a0c1a17e2df95a800c1971762e436c59fcd284

Revised readme

bbioball committed 11 years ago
Unverified
329e83561c477d1cc7ed3f294780d2d22f75991b

Delete .DS_Store

bbioball committed 11 years ago
Unverified
3699eb577f03fa3fd4da202ec58d88823a74d890

Delete .DS_Store

bbioball committed 11 years ago

README

The README file for this repository.

Sudokude

Published on rubygems here: https://rubygems.org/gems/sudokude

Sudokude solves Sudoku puzzles for you! It's a very simple gem, and exposes two methods:

  1. It can solve a sudoku puzzle via .solve
  2. It can stringify the sudoku puzzle (solved or unsolved) via .to_s

Installation

gem install sudokude

Quickstart

  1. Initiate an instance of a Sudoku class with Sudokude::Sudoku#new
  2. Pass in a matrix (array of arrays) for a sudoku puzzle. Each blank cell should be passed in as nil. The array should consist of 9 sub-arrays, one sub-array for each row in a Sudoku puzzle, in order from top to bottom, and left to right. For example, this sudoku puzzle will look like:
[
  [4,   nil, 9,   1,   3,   7,   nil, nil, nil],
  [nil, nil, nil, 8,   2,   9,   nil, 6,   nil],
  [2,   nil, 7,   nil, nil, nil, nil, 9,   nil],
  [nil, 5,   6,   nil, nil, 8,   nil, nil, 9  ],
  [nil, nil, nil, 3,   5,   1,   nil, nil, 6  ],
  [1,   nil, nil, nil, nil, nil, 8,   5,   nil],
  [nil, nil, nil, nil, 1,   nil, 9,   2,   4  ],
  [6,   2,   nil, 7,   nil, 3,   nil, nil, nil],
  [nil, nil, nil, nil, 8,   2,   6,   7,   3  ]
]
  1. Call .sovle on the instance to solve. The gem will either return a solved puzzle, or return an error if the puzzle is not possible to solve