Game Logic
Requirements
The requirement is to define the logic of the game as fully as possible. The intent is to begin with a fairly restricted version of the game, with a view to potentially extending this in the future. The definition is inspired by http://en.wikipedia.org/wiki/Kalah. Where there are possible integer parameters to the game, we will decide what constraints on this number should be whilst leaving a sensible default till extension.
Rules
Here is a concise summary of the rules:
- The Game consists of the following entities: Turn, Move, Player, Action, Board, Store, House, Seed.
- The Board is comprised of k Houses and 1 Store for each player.
- There are two Players and one is designated the opener.
- The layout of the Board is two adjacent rows of Houses of equal length, and a single Store at each end of the combined rows.
- Each row belongs to a different Player and the Store which belongs to the same Player is to be found as the store which appears next when traversing all these items in a clockwise order. This can be seen more clearly in figure 1.
- Before the Game begins the Board is initialised by placing n Seeds in each and every House.
- The Players take it in turn to complete their Turn.
- A Player's Turn is comprised of a finite number of Moves.
- A Move is comprised of committing to a single choice of an Action.
- Currently an Action is fully defined by the selection of a House belonging to the Player.
- For a House to be a valid choice for an action, it must contain at least one Seed. If there is no such House the Game ends.
- The Action when selected is carried out as follow:
- All the Seeds from the given House are removed.
- One Seed is placed in each House or in the active Player's Store, going clockwise around the board, until the same number are placed as have been removed.
- If the final Seed is placed in an empty House that belongs to the active Player, then both said Seed and any Seeds from the opposite House are removed and placed in the active Player's Store.
- If the final Seed is placed in the actioning Player's Store, he is given a further Move else his Turn is over.
- When the Game ends, the opponent of the Player who ended the Game moves all his Seeds to his Store.
- The winner of the Game is the Player with the most number of Seeds in his Store, if the numbers are equal the Game is a draw.
TODO : Add the image of the board and the direction of play.
Potential problems with above description//definitions:
Un-answered questions // Potential future rules:
Potential rules:
- The pie rule : http://en.wikipedia.org/wiki/Pie_rule or some variant thereof.
- Perhaps a different number of rows.
- Selectable
Implications:
Need some sort of configuration page, so players can define the game they are to play.