Mancala.hpp

A simple Malcala game state handler.

class Mancala
#include <Mancala.hpp>

Public Types

using move_t = size_t

Public Functions

inline Mancala(bool A_first = true)
inline ~Mancala()
inline void Reset(bool A_first = true)
inline size_t GetA(size_t i) const
inline size_t GetB(size_t i) const
inline const side_t &GetSideA() const
inline const side_t &GetSideB() const
inline const side_t &GetCurSide() const
inline const side_t &GetOtherSide() const
inline side_t &GetSideA()
inline side_t &GetSideB()
inline side_t &GetCurSide()
inline side_t &GetOtherSide()
inline std::unordered_map<int, double> AsInput(size_t player_id) const
inline vector<double> AsVectorInput(size_t player_id) const
inline bool DoMove(move_t cell)
inline bool DoMove([[maybe_unused]] size_t player, move_t cell)
inline void SetBoard(side_t a, side_t b)
inline bool IsDone() const
inline bool IsMoveValid(size_t move) const
inline vector<move_t> GetMoveOptions()
inline void PrintSmall(const std::string &title = "", std::ostream &os = std::cout)
inline void Print(std::ostream &os = std::cout)
inline size_t GetCurPlayer() const
inline bool IsTurnA() const
inline bool IsTurnB() const
inline size_t ScoreA() const
inline size_t ScoreB() const
inline double GetScore(size_t player)

Private Types

using side_t = array<size_t, 7>

Private Functions

inline void TestOver()

Private Members

side_t boardA
side_t boardB
size_t turn_count
bool over = false
bool is_A_turn