I was bored today, so I whipped up a short 2-player Mancala/Bantumi game in C++ in about an hour. Pretty easy to make, so if you're new to C++ then it might be good to have a browse through, or try creating your own, otherwise all you need to do is put the code into the files specified in bold, then compile to play.
int board::getAdjacent(int prmNmbr)
{
switch(prmNmbr)
{
case 0: return 12;
case 1: return 11;
case 2: return 10;
case 3: return 9;
case 4: return 8;
case 5: return 7;
case 6: return 13;
case 7: return 5;
case 8: return 4;
case 9: return 3;
case 10: return 2;
case 11: return 1;
case 12: return 0;
case 13: return 6;
default: return -1;
}
}
void board::getHeading()
{
system(CLEAR);
for(int a = 0; a < strPlr1.length() + strPlr2.length() + 15; a++)
cout << "-";
INSTRUCTIONS:
It seems some people have never heard of Mancala or Bantumi (obviously, then, you dont have a Nokia phone ) so here are some instructions...
1. Players start with six pots containing four beans each. Players also have a seventh "scoring pot" which starts empty. The layout looks like this:
2. Players take turns selecting a pot from which the beans are taken, and placed one-by-one into the other pots in an anti-clockwise direction. For example:
3. The player with the most beans in the scoring pot at the end wins.
4. Beans cannot be placed in the other players scoring pot.
5. If the last bean ends in the scoring pot (as in the above example), the player receives another turn.
6. If the last bean ends in a pot on the same players side which contains no other beans, the final bean is moved to the scoring pot along with all the beans in the other players adjacent pot. For example, if the pot with 2 beans in the below example is selected, then the player will receive 10 points:
7. A game ends when either player has no beans left in any of their six pots. If, at this time, the other player still has beans remaining, then those beans are added to the other players score.
Mike
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert
I've never used Borland, only VC++, LCC, GCC and G++ for compiling applications in C/C++.
LCC, GCC and G++ are free, but I guess since the EXE is in the zip anyway you dont really need to compile the code unless you want to change it ^__^ You get some people that swear by Borland, so I guess it must be pretty good. I'll have to check it out sometime.
Mike
"Now I guess we're... 'Path-E-Tech Management'" -Dilbert
Haha, i had this game on my Nokia as well. Couldn't figure it out, but it was fun
"Say you're hanging from a huge cliff at the top of mt. everest and a guy comes along and says he'll save you, and proceeds to throw religious pamphlets at you while simultaniously giving a sermon." - Dustin G