项目作者: gabbanaesteban

项目描述 :
Mastermind game implementation in PHP
高级语言: PHP
项目地址: git://github.com/gabbanaesteban/mastermind.git
创建时间: 2021-01-31T22:25:58Z
项目社区:https://github.com/gabbanaesteban/mastermind

开源协议:MIT License

下载


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:

  1. composer require gabbanaesteban/mastermind

Basic Usage

  1. require_once __DIR__ . '/vendor/autoload.php';
  2. use Gabbanaesteban\Mastermind\Mastermind;
  3. use Gabbanaesteban\Mastermind\Color;
  4. $mastermind = Mastermind::withRandomCode();
  5. //OR
  6. $mastermind = new Mastermind([
  7. Color::YELLOW, Color::GREEN, Color::PINK, Color::YELLOW
  8. ]);
  9. $mastermind->getHints([
  10. Color::BLUE, Color::BLUE, Color::YELLOW, Color::YELLOW
  11. ]); // ['white', 'black']

Testing

You can run the tests with:

  1. composer test

Credits

License

The MIT License (MIT). Please see License File for more information.