tic-tac-toe.loc

1.0.0 • Public • Published

MackRais Tic Tac Toe (AngularJs + PHP)

Description

A good old game of tic tac toe. Try your hand against our wonderful bot. MackRais MiniMax Bot v1.0. The bot uses the [Minimax Algorithm] to decide its moves. You can see it on [TicTacToe\User\MiniMaxBot]. You can try game here http://tic-tac-toe.mackrais.com

Getting Started

Use docker

$ docker-compose build 
$ docker-compose up -d 

Start the project with composer:

$ composer install

Running with PHP's Built-in web server

After installing the packages, start PHP's built-in web server:

$ composer run --timeout=0 serve

You can then browse to http://127.0.0.1:4000

If you want to start the serve using port different of 4000, you can start the server manually:

$ php -S 0.0.0.0:_YOU_PORT_ -t public/

If you need Xdebug

$ composer run --timeout=0 serve-xdebug

Response

{
    "board": [
        ["O","O","X"],
        [null,"X",null],
        ["X",null,"O"]
    ],
    "game": { // if game not finished then null
        "winner": "X",
        "coordinates": [
            [0,2],
            [1,1],
            [2,0]
        ]
    },
    "users": {
        "bot": { 
            "userName": "MackRais MiniMax Bot v1.0",
            "symbol": "O"
        },
        "player": { // if user not sign up yet then null
            "userName": "Player",
            "symbol": "X"
        }
    }
}

Package Sidebar

Install

npm i tic-tac-toe.loc

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

63.3 kB

Total Files

31

Last publish

Collaborators

  • mackrais