currently, game ends when either side of the board is empty, and the set_winner function checks for who has the most seeds in their mancala when game has ended.
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.
we need to add a condition to capture all the seeds on the final player side before calling the set_winner function.
proposed solution: a new function final_capture
when mancala_game model fn is_game_finished = true, there should be another function to check to see which player has seeds left in their pits, then we capture all the seeds left in the player's pits to their mancala before set_winner is called.
extra context:
is_game_finished and a conditional check to set_winner is called in every move function call to assist the game client (frontend) determine winner. this solution should be implemented to keep things this way
currently, game ends when either side of the board is empty, and the
set_winner
function checks for who has the most seeds in their mancala when game has ended.we need to add a condition to capture all the seeds on the final player side before calling the
set_winner
function.proposed solution: a new function
final_capture
when mancala_game model fn
is_game_finished
= true, there should be another function to check to see which player has seeds left in their pits, then we capture all the seeds left in the player's pits to their mancala beforeset_winner
is called.extra context:
is_game_finished
and a conditional check toset_winner
is called in everymove
function call to assist the game client (frontend) determine winner. this solution should be implemented to keep things this way