Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Requirements specification

Backgammon Mahbouseh

By Fouad Hojeij Nadim Mansour Tala Hamdan Mohammad Hammoud.

1) At the beginning the board is empty and does not contain any stone neither Red nor black). The starting of the game depends on the highest dice rolled by the player , it is either a red player or a black player. The board consists of 4 blocks , each block contains 6 points. Each player will have 15 stones . We are going to represent the stones by an array of 24 slots from 1 to 24 . The stones are outside the board . //Requires: Empty board; it does not contain any stone , each player chooses a color , either black or red . 2 dices that the player will use to move his stones . Array dices[1..24] //Modifies: Every time a player rolls the dice , the positions of the stones will change according to the number obtained by the dices //Effects: Each player will move his stones, and the winner will is the player who arrives to the ending position before the other, and while moving he is allowed to slow down his opponent by moving the opponents dice outside the board , in case he had the same position as the opponents dice.

2) Legal board positions: At the beginning, location is empty for both Red player and black player. If red player has a specific location in the array (a stone on the board)and black player came to it , black player will eat the stone and the same strategy will happen if Red player came to a position already taken by a black stone. If a red player or a black player has more than 1 stone on a specific location, neither red player nor black player has the right to eat this stone If a red or black player came to a position that has a stone on it he can either move it or put the next stone above it.

3)

A checker may be moved only to an open point, one that is not occupied by two or more opposing checkers. The numbers on the two dice constitute separate moves. For example, if a player rolls 2 and 1, he may move one checker 2 spaces to an open point and another checker 1 space to an open point, or he may move the one checker a total of 3 spaces to an open point, but only if the intermediate point (either 1 or 2 spaces from the starting point) is also open. A player who rolls doubles plays the numbers shown on the dice twice. A roll of 4 and 4 means that the player has 4 fours to use, and he may move any combination of checkers he feels appropriate to complete this requirement. A player must use both numbers of a roll if this is legally possible (or all four numbers of a double). When only one number can be played, the player must play that number. Or if either number can be played but not both, the player must play the larger one. When neither number can be used, the player loses his turn. In the case of doubles, when all four numbers cannot be played, the player must play as many numbers as he can. 4) Point(124) represents all the positions on the board. Initial(r) = ( Initial(b) = ( R: R RedStones : R (point 24)). B: B BlackStones : B (point 1)). R: R RedStones: R Point(124) B: B Point (124)).

Winning(r) = (

Winning (b) = (

B: B BlackStones: B Point(124) R: R Point (124)).).

You might also like