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

mgl_initgame, mgl_playturn, mgl_endgame, — Turkish mancala game library

#include <mangala.h>

struct mgl_game;

int
mgl_endgame(struct mgl_game *game);

int
mgl_playturn(struct mgl_game *game, int sel);

void
mgl_initgame(struct mgl_game *game);

Descriptions of fucntions:

mgl_initgame
initializes the game. Sets internal variables and does some initializing tasks.
mgl_playturn
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.
mgl_endgame
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 https://kurth4cker.codeberg.page/mangala

https://kurth4cker.codeberg.page/libmangala

kurth4cker <kurth4cker@tutanota.com>

For reporting bugs, please use: https://codeberg.org/kurth4cker/libmangala/issues

05 Dec, 2022 GNU/Linux