gabbanaesteban / mastermind

Mastermind game implementation in PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Social Card of Mastermind

Mastermind

Latest Stable Version GitHub Workflow Status Total Downloads Latest Unstable Version License

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.

About

Mastermind game implementation in PHP

License:MIT License


Languages

Language:PHP 100.0%