Giter Site home page Giter Site logo

mancala's People

Contributors

katzuv avatar

Watchers

 avatar

mancala's Issues

Implement "move" of Board

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.

Implement Board's game over

Check whether the game has ended with self._has_game_ended. If so, deposit all the stones in each player's pit to their store. The winner is the player who has more stones in their store.

Add "board" field to Pit

Pit.board represents the board the pit is in. board should be passed through the constructor of Pit.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.