chipulaja/algo-backtrack-sudoku

a library for solving sudoku

v1.0 2021-01-01 22:19 UTC

This package is auto-updated.

Last update: 2024-10-29 06:12:20 UTC


README

Latest version Build Status Coverage Status Quality Score Total Downloads

a library for solving sudoku.

Table of contents

Install

Via Composer

$ composer require chipulaja/algo-backtrack-sudoku

Usage

use Chipulaja\Algo\Backtrack\Sudoku\SudokuSolverCara1;

$data = [
    [0,2,0,  0,1,3,  0,6,0],
    [0,0,5,  6,0,0,  3,4,0],
    [0,0,0,  0,0,0,  0,0,0],

    [1,0,2,  0,7,0,  0,8,5],
    [0,9,0,  0,0,2,  0,0,0],
    [7,0,0,  0,3,0,  0,0,0],

    [0,0,0,  3,0,5,  9,0,0],
    [0,0,0,  0,2,0,  0,5,1],
    [0,0,0,  8,0,0,  0,7,0]
];

$solver = new SudokuSolverCara1();
$solver->tryToSolve($data);
$answerBoard = $solver->getAnswerBoard();

Testing

$ vendor\bin\phpunit