PHPackages                             gabbanaesteban/mastermind - 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. gabbanaesteban/mastermind

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

gabbanaesteban/mastermind
=========================

Mastermind game implementation in PHP

v1.0.2(5y ago)18MITPHPPHP ^7.4

Since Feb 1Pushed 5y ago1 watchersCompare

[ Source](https://github.com/gabbanaesteban/mastermind)[ Packagist](https://packagist.org/packages/gabbanaesteban/mastermind)[ RSS](/packages/gabbanaesteban-mastermind/feed)WikiDiscussions main Synced 4w ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

[![Social Card of Mastermind](/art/socialcard.png)](/art/socialcard.png)

Mastermind
==========

[](#mastermind)

[![Latest Stable Version](https://camo.githubusercontent.com/3adae0418e7e7dae24f81cc5f60c35b2235e998eeed122b04115c91e26d847ec/68747470733a2f2f706f7365722e707567782e6f72672f67616262616e616573746562616e2f6d61737465726d696e642f76)](//packagist.org/packages/gabbanaesteban/mastermind) [![GitHub Workflow Status](https://camo.githubusercontent.com/59ef6e8709c3ef5350c334d15cd586977159a4cf1b39d995dfd5ae0900c9256f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f67616262616e616573746562616e2f6d61737465726d696e642f74657374733f6c6162656c3d7465737473)](//github.com/gabbanaesteban/mastermind/actions) [![Total Downloads](https://camo.githubusercontent.com/183bacbaab3f0feb3453a4444afef5ef52188f45806ef8100cee4ad425cbc480/68747470733a2f2f706f7365722e707567782e6f72672f67616262616e616573746562616e2f6d61737465726d696e642f646f776e6c6f616473)](//packagist.org/packages/gabbanaesteban/mastermind) [![Latest Unstable Version](https://camo.githubusercontent.com/afc43401ae27fd4b4408ac6f960167356542bcc895d6b98caac36df5395de0bb/68747470733a2f2f706f7365722e707567782e6f72672f67616262616e616573746562616e2f6d61737465726d696e642f762f756e737461626c65)](//packagist.org/packages/gabbanaesteban/mastermind) [![License](https://camo.githubusercontent.com/d1e033e8c70a5bacd79bd0e3e486319b89338555ebc8478d4ef3a76d857f39a4/68747470733a2f2f706f7365722e707567782e6f72672f67616262616e616573746562616e2f6d61737465726d696e642f6c6963656e7365)](LICENSE.md)

This package is an implementation of the Mastermind game.

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

[](#requirements)

This package requires PHP 7.4 or higher.

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

[](#installation)

You can install the package via composer:

```
composer require gabbanaesteban/mastermind
```

Basic Usage
-----------

[](#basic-usage)

```
require_once __DIR__ . '/vendor/autoload.php';

use Gabbanaesteban\Mastermind\Mastermind;
use Gabbanaesteban\Mastermind\Color;

$mastermind = Mastermind::withRandomCode();

//OR

$mastermind = new Mastermind([
    Color::YELLOW, Color::GREEN, Color::PINK, Color::YELLOW
]);

$mastermind->getHints([
    Color::BLUE, Color::BLUE, Color::YELLOW, Color::YELLOW
]); // ['white', 'black']
```

Testing
-------

[](#testing)

You can run the tests with:

```
composer test
```

Credits
-------

[](#credits)

- [Esteban De la Rosa](https://github.com/gabbanaesteban)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 95.7% 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 ~1 days

Total

3

Last Release

1921d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5dd4cf8ad3f42fb89ecbba6b50bb3fe7b8a67427b9ddb8cb4cc4a83def21e3aa?d=identicon)[gabbanaesteban](/maintainers/gabbanaesteban)

---

Top Contributors

[![gabbanaesteban](https://avatars.githubusercontent.com/u/11374198?v=4)](https://github.com/gabbanaesteban "gabbanaesteban (22 commits)")[![ImgBotApp](https://avatars.githubusercontent.com/u/31427850?v=4)](https://github.com/ImgBotApp "ImgBotApp (1 commits)")

---

Tags

gamemastermindmastermind-gamegamemastermind

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/gabbanaesteban-mastermind/health.svg)

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

###  Alternatives

[irfa/php-gatcha

Simple Items Gatcha with PHP

362.4k](/packages/irfa-php-gatcha)

PHPackages © 2026

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