Aboruhen / kalah

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kalah Game

This a simple POC a game in rest format.
This is a game of 6-stone Kalah. Wikipedia: https://en.wikipedia.org/wiki/Kalah.

API documentation

Normally a good practise would be to first crate the api documentation. For example using an OpenAPI

Create new game

Sequence diagram

Make a move

Sequence diagram

Play the game

There were no UI requirements. For an issue play Postman collections can be used. Default port is set to 8081. (http://localhost:8081) Load collection Kalah.postman_collection Then using one of a plugin to generate respective API interface for implementation.

My preference would be a BOAT plugin as it's really simple a cover mostly all needed cases out of the box

About the game

The player who begins picks up all the stones in any of their own pits, and sows the stones on to the right, one in each of the following pits, including his own Kalah. No stones are put in the opponent's' Kalah. If the players last stone lands in his own Kalah, he gets another turn. This can be repeated any number of times before it's the other player's turn.

When the last stone lands in an own empty pit, the player captures this stone and all stones in the opposite pit (the other players' pit) and puts them in his own Kalah.

The game is over as soon as one of the sides run out of stones. The player who still has stones in his/her pits keeps them and puts them in his/hers Kalah. The winner of the game is the player who has the most stones in his Kalah

Install & Running

Prerequisites

Pull from git

$ git clone https://github.com/Aboruhen/kalah.git
$ cd kalah

Build & run

  • How to manage different java versions
$ sdk list java
$ sdk install java 17.0.1-oracle
$ sdk use java  17.0.1-oracle
  • Run test
$ mvn test
  • Run the web server on dev mode
$ mvn spring-boot:run

Built With

About


Languages

Language:CSS 53.4%Language:Java 35.1%Language:HTML 6.8%Language:Smarty 4.4%Language:Dockerfile 0.4%