Pooja Casula
  • About
  • Work

Mancala

​Description 

Final Project for 15-110 Principles of Computing - Fall 2016
There are 2 players, (0 and 1)
Each player has six pits, 5 are houses and 1 is a store
Player 0 has pits from 0 through 6, 0 through 5 are houses and pit 6 is a store
Player 1 has pits from 7 through 13, 7 through 12 are houses and pit 13 is a store 
The objective of the game is to get as many pebbles into your store as possible. 
The player with the most amount of the pebbles in their store, wins. 
The first player is player 0
They select a pit out of the valid ones provided, and take all the pebbles in it. 
They distribute one pebble at a time in subsequent pits until the pebbles run out.  
If the last pebble is dropped into the player's store, they can go again
If not, then the next player goes and they follow the same set of steps. 
After each turn, the game checks if there are any pebbles remaining:
    If so, the game continues
    If not, the game ends
If the player wants to quit at any point, they simply type quit when prompted to choose a pit
In that case the game will print "Goodbye" and quit the game

Creative Process

1. The Model
This game heavily relied on the MVC structure for its own code structure.
The Model refers to the structure of the board and the technicalities of the game. Functions such as "new_board", which created the board, and "has_move", which checks which player's turn it is, are a part of. 
Picture
Code excerpt
2. The View
The View part of the game refers to the actual graphics displayed in the game. The graphics and images were generated in Tkinter, a built-in module in Python. 
Picture
Code excerpt
3. The Controller
The Controller essentially combines the model and the view parts of the code to "control" the game. Functions such as "run_game" are located in this part of the game. 
Picture
Code excerpt
Picture
  • About
  • Work