realm-of-ra / mancala

https://meowing-anteater-cee.notion.site/Mancala-Game-MVP-7521e2f2e5294575b33b17601afde810
MIT License
9 stars 23 forks source link

bug: determining game winner #103

Open okhaimie-dev opened 1 week ago

okhaimie-dev commented 1 week ago

image

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

linear[bot] commented 1 week ago

MAN-21 bug: determining game winner

okhaimie-dev commented 1 week ago

I created this issue for @TAdev0

TAdev0 commented 1 week ago

i'm on it @okhaimie-dev will push the PR for it tomorrow

Josh-121 commented 1 week ago

Just incase it's gonna be available. I'm ready to implement this. Thanks