Py-Mancala
  1. All files
  2. Casio Prizm (fx-CG) Programs and Games
  3. Casio Prizm (fx-CG) Games

Description

This is a two-player game of Mancala, written in Python and built for the fx-CG50. Press AC when the outline is around the space you want to move. Let it load (this is also the point where you can exit the game if you wish), and after a few seconds, the next turn will start. At the bottom of the screen, news about the game will appear, such as when counters are stolen or free turns are acquired.

There are two Python files: Mancala, and MancalaC. C stands for compressed, and is way less readable in terms of code. However, it plays exactly the same, so if you aren't interested in the code, save on memory and choose MancalaC.

How to play Mancala:

The game begins with the blue player picking up all of the pieces in any one of the spaces on their side. Moving counter-clockwise, the player deposits one of the counters in each hole until the stones run out.

1. If you run into your own store, one counter is placed in it. If you run into your opponent's store, skip it.
2. If the last counter you drop is in your own store, you get a free turn.
3. If the last counter you drop is in an empty hole on your side, you capture that counter and any counters in the hole directly opposite.
4. All captured counters are placed in your store.

The game ends when all six spaces on one side of the Mancala board are empty. The player who still has pieces on his side of the board when the game ends captures all of those pieces. The winner is the player with the most pieces, but can also end in a draw if each player ends with 24 counters.

Known bug: Green doesn't steal from blue when their go ends on their penultimate space from the right, even when it should. TBH, I have spent too many hours trying to come up with the formulas for stealing (just look at line 98 on the uncompressed version), so fixing this is quite a low priority. This scenario shouldn't happen very often as well, as it requires green's counter setup to be exactly 00-01 (closest two spaces to the right) and also requires there to be counters in blue's penultimate from the right.

Screenshots

Screenshot #8642 Screenshot #8643 Screenshot #8644

Archive Contents

Name Size
Pycala/Mancala.py 5.7 KB
Pycala/MancalaC.py 3.9 KB
Pycala/README.txt 2.0 KB
Download file
File Size
4.5 KB

Metadata

Author
cg50
Uploaded
1 year ago

Statistics

Rating
No ratings.
Downloads
164
Views
814

Reviews

Nobody has reviewed this file yet.

Versions

  1. Py-Mancala (published 1 year ago; 2023-04-13 10:39 UTC)

Advertisement