https://github.com/gabbanaesteban/mastermind
Mastermind game implementation in PHP
https://github.com/gabbanaesteban/mastermind
game mastermind mastermind-game
Last synced: about 1 year ago
JSON representation
Mastermind game implementation in PHP
- Host: GitHub
- URL: https://github.com/gabbanaesteban/mastermind
- Owner: gabbanaesteban
- License: mit
- Created: 2021-01-31T22:25:58.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-02-10T00:34:49.000Z (over 5 years ago)
- Last Synced: 2025-05-05T07:14:51.048Z (about 1 year ago)
- Topics: game, mastermind, mastermind-game
- Language: PHP
- Homepage:
- Size: 225 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README

# Mastermind
[](//packagist.org/packages/gabbanaesteban/mastermind) [](//github.com/gabbanaesteban/mastermind/actions) [](//packagist.org/packages/gabbanaesteban/mastermind) [](//packagist.org/packages/gabbanaesteban/mastermind) [](LICENSE.md)
This package is an implementation of the Mastermind game.
## Requirements
This package requires PHP 7.4 or higher.
## Installation
You can install the package via composer:
``` bash
composer require gabbanaesteban/mastermind
```
## Basic Usage
```php
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
You can run the tests with:
```bash
composer test
```
## Credits
- [Esteban De la Rosa](https://github.com/gabbanaesteban)
- [All Contributors](../../contributors)
## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.