PHPackages                             romanpiller/sudoku - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. romanpiller/sudoku

ActivePackage[Utility &amp; Helpers](/categories/utility)

romanpiller/sudoku
==================

Sudoku solver

1.0.2(1mo ago)014↓83.3%1MITHTMLPHP ^8.2

Since Jun 20Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/romanpiller/sudoku)[ Packagist](https://packagist.org/packages/romanpiller/sudoku)[ RSS](/packages/romanpiller-sudoku/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (2)Dependencies (8)Versions (4)Used By (1)

Sudoku Solver
=============

[](#sudoku-solver)

A simple and efficient tool for solving Sudoku grids written in PHP. The package supports various output formats (text, HTML) and is ready for integration into Nette projects.

Installation
------------

[](#installation)

The package can be installed using Composer:

```
composer require romanpiller/sudoku
```

Requirements
------------

[](#requirements)

- PHP 8.2 or higher

Usage
-----

[](#usage)

The main entry point for working with the package is `SudokuFacade`.

### Usage Example

[](#usage-example)

```
use RomanPiller\Sudoku\Facades\SudokuFacade;

// Facade initialization (ideally via DI container)
// $facade = $container->getByType(SudokuFacade::class);

// If the facade is configured via DI, just call solve with the filename
$result = $facade->solve(
    inputFilename: 'input.txt',
    inputDirectory:  __DIR__ . '/../../examples',
    stdOut: true,
    outputFilename: 'example-hard.html',
    outputDirectory: __DIR__ . '/../../temp'
);

if ($result) {
    echo "Sudoku was successfully solved.";
} else {
    echo "Failed to solve Sudoku.";
}
```

### Input File Format

[](#input-file-format)

The input file should contain 81 numbers (values 0-9) separated by commas. Zero (0) represents an empty cell. Whitespace (spaces, tabs, etc.) and newlines are ignored during processing.

Example `input.txt`:

```
5,3,0,0,7,0,0,0,0,
6,0,0,1,9,5,0,0,0,
0,9,8,0,0,0,0,6,0,
8,0,0,0,6,0,0,0,3,
4,0,0,8,0,3,0,0,1,
7,0,0,0,2,0,0,0,6,
0,6,0,0,0,0,2,8,0,
0,0,0,4,1,9,0,0,5,
0,0,0,0,8,0,0,7,9

```

Configuration in Nette
----------------------

[](#configuration-in-nette)

The best way to register the package in Nette is to use the DI extension:

```
extensions:
    sudoku: RomanPiller\Sudoku\Config\Extension
```

Development and Testing
-----------------------

[](#development-and-testing)

The project includes a set of tools for maintaining code quality:

### Static Analysis (PHPStan)

[](#static-analysis-phpstan)

```
composer phpstan
```

### Code Quality Check (PHP CodeSniffer)

[](#code-quality-check-php-codesniffer)

```
composer phpcodesniffer
```

### Unit Tests (Nette Tester)

[](#unit-tests-nette-tester)

```
composer unit
```

### Test Coverage

[](#test-coverage)

```
composer cover
```

### Manual Tests

[](#manual-tests)

```
composer manual
```

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

3

Last Release

47d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5c089d5663490f46fa96154c254086b5a8a14429a61760269d2c76dcedd3ff2a?d=identicon)[Roman Piller](/maintainers/Roman%20Piller)

---

Top Contributors

[![romanpiller](https://avatars.githubusercontent.com/u/11993544?v=4)](https://github.com/romanpiller "romanpiller (5 commits)")

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/romanpiller-sudoku/health.svg)

```
[![Health](https://phpackages.com/badges/romanpiller-sudoku/health.svg)](https://phpackages.com/packages/romanpiller-sudoku)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
