PHPackages                             davaxi/takuzu - 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. davaxi/takuzu

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

davaxi/takuzu
=============

PHP Class to check and resolve step by step Takuzu grids

1.0.8(9y ago)218MITPHPPHP &gt;=5.4.0

Since Sep 15Pushed 9y ago1 watchersCompare

[ Source](https://github.com/davaxi/Takuzu)[ Packagist](https://packagist.org/packages/davaxi/takuzu)[ RSS](/packages/davaxi-takuzu/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (10)Used By (0)

Takuzu
======

[](#takuzu)

PHP Class to check and resolve by step (with explain) Takuzu grids.

[![Build Status](https://camo.githubusercontent.com/237f7ccdd3e39b04b0b5be6bd93e6d0de075cee5372b2fb9065da2afe7ba83de/68747470733a2f2f7472617669732d63692e6f72672f6461766178692f54616b757a752e737667)](https://travis-ci.org/davaxi/Takuzu)[![Latest Stable Version](https://camo.githubusercontent.com/d35aa3a5afdad0623ea0d18f4a4d5485460e2d494f48ae3290830220ca362ab3/68747470733a2f2f706f7365722e707567782e6f72672f6461766178692f74616b757a752f762f737461626c65)](https://packagist.org/packages/davaxi/takuzu)[![Total Downloads](https://camo.githubusercontent.com/dba309898cc2ecb699d0ec24dc0cade2469da6868180d6977972ff823f2d7f33/68747470733a2f2f706f7365722e707567782e6f72672f6461766178692f74616b757a752f646f776e6c6f616473)](https://packagist.org/packages/davaxi/takuzu)[![Latest Unstable Version](https://camo.githubusercontent.com/ca4f0f48546e2d52387117ea5af7d7e2a0c8e6406b05f610edff2e5939bc7438/68747470733a2f2f706f7365722e707567782e6f72672f6461766178692f74616b757a752f762f756e737461626c65)](https://packagist.org/packages/davaxi/takuzu)[![License](https://camo.githubusercontent.com/6dc72c430ba7b6b2749185c7f69cb680bc7706dc9bc67419d1cd072692b3507f/68747470733a2f2f706f7365722e707567782e6f72672f6461766178692f74616b757a752f6c6963656e7365)](https://packagist.org/packages/davaxi/takuzu)[![Code Climate](https://camo.githubusercontent.com/45b6f4d1707d02986598c7768b24af477b49ef5181d189ed91c7eec4931dd3b1/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6461766178692f54616b757a752f6261646765732f6770612e737667)](https://codeclimate.com/github/davaxi/Takuzu)[![Test Coverage](https://camo.githubusercontent.com/e07053f47dd2d98223051f9eca3275b759afd568948df595b19f459554226721/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6461766178692f54616b757a752f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/davaxi/Takuzu/coverage)[![Issue Count](https://camo.githubusercontent.com/7636cdbb8c997e151321635b3eb9cf3b359944fdb57a7da15ff7407e57af551c/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6461766178692f54616b757a752f6261646765732f69737375655f636f756e742e737667)](https://codeclimate.com/github/davaxi/Takuzu)

Game
----

[](#game)

Takuzu is a logic-based number placement puzzle. The objective is to fill a (usually 10×10) grid with 1s and 0s, where there is an equal number of 1s and 0s in each row and column and no more than two of either number adjacent to each other. Additionally, there can be no identical rows or columns.

Source: [Wikipédia](https://en.wikipedia.org/wiki/Takuzu)

Solving Methods
---------------

[](#solving-methods)

- Each row and each column should contain an equal number of 0s and 1s. If the required number of 0s or 1s is reached in a row or a column, the remaining cells should contain the other number. (1xx101 - 100101)
- More than two of the same number can't be adjacent. If two adjacent cells contain the same number, the cells next to the numbers should contain the other number. (xxx00x - xx1001) If two cells contain the same number with an empty cell between, this empty cell should contain the other number because otherwise three same number appears. (x1x1xx - x101xx)
- Each row and column is unique. (100101 1001xx - 100101 100110)
- Eliminate impossible combinations. For example, 110xxx, the cell n°6 should contain 0 because otherwise a trio appears (110xx1 - 110001)

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

[](#installation)

This page contains information about installing the Library for PHP.

### Requirements

[](#requirements)

- PHP version 5.4.0 or greater

### Obtaining the client library

[](#obtaining-the-client-library)

There are two options for obtaining the files for the client library.

#### Using Composer

[](#using-composer)

You can install the library by adding it as a dependency to your composer.json.

```
  "require": {
    "davaxi/takuzu": "^1.0"
  }

```

#### Cloning from GitHub

[](#cloning-from-github)

The library is available on [GitHub](https://github.com/davaxi/Takuzu). You can clone it into a local repository with the git clone command.

```
git clone https://github.com/davaxi/Takuzu.git

```

### What to do with the files

[](#what-to-do-with-the-files)

After obtaining the files, ensure they are available to your code. If you're using Composer, this is handled for you automatically. If not, you will need to add the `autoload.php` file inside the client library.

```
require '/path/to/takuzu/folder/autoload.php';

```

Examples
--------

[](#examples)

```
