Mancala is an ancient African two player game that is played by moving
stones to different pits on a board. The board consists of two rows of
six pits capped on both ends with two larger pits called mancalas as illustrated
below:
The pits on the bottom row and the mancala on the right belong to player
0 and the pits on top row and the mancala on the left belong to player
1. The board contains 48 stones (black dots above). Initially the stones
are arranged with four stones per pit and the mancalas are empty as shown.
The object of the game is to capture more stones than your opponent.
The following four simple rules describe the game and are written assuming
you are a player:
| The following algorithm is mainly written in the main function, however
most subtasks are implemented in seperate functions. To use top-down design, we would write the basic steps in to main, and implement the functions as stubs. Completely the program would involve fully implementing the stubs. 1) Create Board
|
b.) [____ / 8 points] Coding: Discuss the implementation
of your design. How would you represent the various aspects of the game?
What coding constructs would you use in your implementation? What are some
of the coding details that would be most challenging to implement?
| Board would be a 1D or 2d array of integers.
Do-While/While loop for parts 2 -> 6. (2 points)
|
c.) [____ / 7 points] Testing: Describe the issues of
testing your program. What tests would you use to verify that your implementation
works as specified? How would you organize the work of testing your program?
What specific potential problems could you foresee and how would you test
your program to insure that they don't occur in your code?
| In general, use drivers to test seperate functions.
Start with movement, and check that all possibilities work.
Next, add on checking functions
Next, set up program for "interactive mode"
Lastly, test the ending game function. |