gabbanaesteban / mastermind
Mastermind game implementation in PHP
v1.0.2
2021-02-03 07:24 UTC
Requires
- php: ^7.4
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.18
- pestphp/pest: ^1.0
- phpstan/phpstan: ^0.12.70
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Mastermind
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:
composer require gabbanaesteban/mastermind
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
You can run the tests with:
composer test
Credits
License
The MIT License (MIT). Please see License File for more information.
