alexdestebekou / php-project-lvl1
Brain games is first project from Hexlet by Alexander Karakin!
v3.0.1
2020-10-02 08:19 UTC
Requires
- wp-cli/php-cli-tools: ^0.11.11
Requires (Dev)
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-04 02:13:25 UTC
README
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 |