Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement "move" of Board #5

Open
katzuv opened this issue Dec 30, 2018 · 0 comments
Open

Implement "move" of Board #5

katzuv opened this issue Dec 30, 2018 · 0 comments
Assignees
Labels

Comments

@katzuv
Copy link
Owner

katzuv commented Dec 30, 2018

Board.move should get the pit which was chosen in the last turn, and implement the whole turn (preferably through a couple of methods). The steps are:

  • change player from up to down and vice versa
  • enable self.player's pits.
  • deposit the stones in the pits following the above-mentioned pit (remember to skip the opponent's store and not skip the player's store). This step should be called sowing.
  • at the end of turn, check whether the last stone fell in
    • the player's store. If so, grant the player another turn
    • an empty pit. If so, the player captures that piece and any pieces in the pit directly opposite
  • call self._game_over_if_needed.
  • disable self.player's pits. Maybe this post can help with that.
  • change player from up to down and vice versa.

The full rules of Mancala, if needed, can be found here.

@katzuv katzuv added the board label Dec 30, 2018
@katzuv katzuv self-assigned this Dec 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant