The application have an API that can be called to make the moves, and a web interface, where the application can be visible.
Project include:
👍 The game inside
👍 API
👍 Test coverage:: OK (18 tests, 40 assertions)
👍 Code amalyze coverage (PSR2 standart, Phan, Codesniffe, Calisthenics rules)
Feature:
- Cache warm before first start
- To expand API functions
- Make server answer faster
MiniMax algorithm is used to implement basic AI or game logic in 2 player games. The most common scenario is implementing a perfect Tic-Tac-Toe player. In the game of Tic-Tac-Toe, there are two players, player X and player O. Now imagine there’s a scoreboard which displays a huge number called “score”.
-
If X wins, the score increases by 10.
-
If O wins, the score is decreased by 10.
-
If it is a draw, then the score remains unchanged.
So now, the bigger the number score has, the better it is for X, which means X will try to maximize score as much as possible. Similarly, the lesser the score, the better it is for O, so O will try to minimize the score as much as possible. To understand this better, read the article or article or article.
For realization, I did not take heavy framework. I take my simple skeleton.
For run a server - you can create a the docker container(php7.2 + nginx) as the main platform, and put server code here. Example. If you have any problem with a start please contact me. Or if you have a exist server put server code here.
For up you server you need run only one command:
composer install
after that creating a .env
file with server configuration.
key | description | type |
---|---|---|
log_path | Path for you log folder | string |
debug_mode | debag mode | bool |
cache_mode | cache mode | bool |
The client code lies in the Client folder.
For run a client you just a need change for your path
a GAME_URL_API
const, in the main.js file.
Dykyi Roman, e-mail: mr.dukuy@gmail.com