LIBMANGALA(3) Library Functions Manual (prm) LIBMANGALA(3)

mgl_initgame, mgl_playturn, mgl_endgame, — Turkish mancala game library

#include <mangala.h>

struct mgl_game;

mgl_endgame(struct mgl_game *game);

mgl_playturn(struct mgl_game *game, int sel);

mgl_initgame(struct mgl_game *game);

Descriptions of fucntions:

initializes the game. Sets internal variables and does some initializing tasks.
Plays turn at once. Firstly it starts turn. Second argument should be a integer between 1 and 6. Then it does internal actions. Shares rocks to pits. At the end it checks end-of-turn state. If second argument not setted correctly, it resturns MGL_ERR.
checks for is game finished? If true it checks who finished the game and puts all remaining rocks to his/her collection.

retuns MGL_ERR if sel is not true. Otherwise it returns MGL_OK.

For a complete example/demo please see

kurth4cker <>

For reporting bugs, please use:

05 Dec, 2022 GNU/Linux