GitXplorerGitXplorer
b

sudokude

public
12 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
622f8113233abde120b942279799a848e93f0668

Better description

bbioball committed 11 years ago
Unverified
8f1f2a2ea7c761b470ccc3d72e39159ae8eac57a

rolling out 1.0.3

bbioball committed 11 years ago
Unverified
600f1e8356199b11e8ce933dfa96583a3359cffe

added tests, slight refactoring of code

bbioball committed 11 years ago
Unverified
220131690aa3969975a1857366574ddd5cd752e8

update readme

bbioball committed 11 years ago
Unverified
6cb317389ed6527ef41c12bed4f2c04e1c6cd893

Update README.md

bbioball committed 11 years ago
Unverified
4c14838b2d8daca6242e3971213aa7d1f50eba06

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