chipulaja/algo-sudoku-generator

a library for generate sudoku

v1.0 2021-02-13 20:51 UTC

This package is auto-updated.

Last update: 2024-11-14 06:10:03 UTC


README

Latest version Build Status Coverage Status Quality Score Total Downloads

a library for generate sudoku.

Table of contents

Install

Via Composer

$ composer require chipulaja/algo-sudoku-generator

Usage

use Chipulaja\Algo\Sudoku\Generator;
use Chipulaja\Algo\Sudoku\GeneratorHelper;

$generator = new Generator();
$data = $generator->generate();

$helper = new GeneratorHelper();
echo $helper->getBoard($data);

/*
  -----------------------
 | 8 2 9 | 4 3 5 | 7 6 1 | 
 | 5 7 4 | 6 1 8 | 3 2 9 | 
 | 1 3 6 | 2 9 7 | 4 8 5 | 
  -----------------------
 | 3 1 8 | 5 7 6 | 2 9 4 | 
 | 4 9 2 | 1 8 3 | 6 5 7 | 
 | 7 6 5 | 9 4 2 | 1 3 8 | 
  -----------------------
 | 9 4 3 | 8 2 1 | 5 7 6 | 
 | 2 5 1 | 7 6 9 | 8 4 3 | 
 | 6 8 7 | 3 5 4 | 9 1 2 | 
  -----------------------

*/

Testing

$ vendor\bin\phpunit