Search by

alexdestebekou / php-project-lvl1

BotServicePro

Brain games is first project from Hexlet by Alexander Karakin!

Package info

github.com/BotServicePro/php-project-lvl1

pkg:composer/alexdestebekou/php-project-lvl1

Statistics

Installs: 45

Dependents: 0

Suggesters: 0

Stars: 1

v3.0.1 2020-10-02 08:19 UTC

README

Github Actions Status

Brain Games

A pack of seven console math quiz games written in pure PHP (no framework) — my first project on the Hexlet PHP track.

Each game asks three questions. Answer all of them correctly and you win; give one wrong answer and the game is over.

Game Command What it asks
Even check brain-even Is the number even?
Calculator brain-calc Result of a random arithmetic expression
GCD brain-gcd Greatest common divisor of two numbers
Progression brain-progression The missing element of an arithmetic progression
Prime check brain-prime Is the number prime?
Roman to number brain-romanToNumber Convert a Roman numeral to a number
Number to Roman brain-numberToRoman Convert a number to a Roman numeral

What this project demonstrates

  • Composer package structure with executable entry points in bin/
  • Clean separation of game engine and game logic (src/)
  • GitHub Actions CI and CodeClimate maintainability checks

Installation

git clone https://github.com/BotServicePro/php-project-lvl1.git
cd php-project-lvl1
composer install

Installation demo:

Usage

Run any game directly, for example:

php bin/brain-even

Or launch the menu and pick a game interactively:

php bin/allGames

Demos

Game Demo
Even check asciinema
Calculator asciinema
GCD asciinema
Progression asciinema
Prime check asciinema
Roman to number asciinema
Number to Roman asciinema