shane-lab / mancala

mancala game in es next

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mancala game

Play the Mancala game against a computer / an other player in a local network.

Setup

Docker build below

Install Node or Yarn.

npm install # or | yarn install

After installing the dependencies, the app will be built and bundled automatically. If the post install step failed, you'd have to build and bundle the source manually:

npm run build # or | yarn build

Hereafter, enter the following script to serve the application locally:

npm start # or | yarn start

Containerized

Besides local installation, you may run a container of the accompanied Dockerfile

docker build -t mancala_app . 
docker run -it --rm -p 8080:8080 mancala_app

Once the server (or container) is up and running, navigate to http://localhost:8080/.

Game rules

  1. At the beginning of the game, four seeds are placed in each house. This is the traditional method.
  2. Each player controls the six houses and their seeds on the player's side of the board. The player's score is the number of seeds in the store to their right.
  3. Players take turns sowing their seeds. On a turn, the player removes all seeds from one of the houses under their control. Moving counter-clockwise, the player drops one seed in each house in turn, including the player's own store but not their opponent's.
  4. If the last sown seed lands in an empty house owned by the player, and the opposite house contains seeds, both the last seed and the opposite seeds are captured and placed into the player's store.
  5. If the last sown seed lands in the player's store, the player gets an additional move. There is no limit on the number of moves a player can make in their turn.
  6. When one player no longer has any seeds in any of their houses, the game ends. The other player moves all remaining seeds to their store, and the player with the most seeds in their store wins.

About

mancala game in es next


Languages

Language:JavaScript 81.4%Language:CSS 17.9%Language:HTML 0.6%Language:Dockerfile 0.2%