About the game: https://en.wikipedia.org/wiki/Mancala
- The Mancala board is made up of two rows of six holes, or pits, each. If you don't have a Mancala board handy, substitute an empty egg carton.
- Four pieces—marbles or stones—are placed in each of the 12 holes. The color of the pieces is irrelevant.
- Each player has a store to the right side of the Mancala board. (Cereal bowls work well for this purpose if you're using an egg carton.)
- The game begins with one player picking up all of the pieces in any one of the holes on his side.
- Moving counter-clockwise, the player deposits one of the stones in each hole until the stones run out.
- If you run into your own store, deposit one piece in it. If you run into your opponent's store, skip it.
- If the last piece you drop is in your own store, you get a free turn.
- If the last piece you drop is in an empty hole on your side, you capture that piece and any pieces in the hole directly opposite.
- Always place all captured pieces in your store.
- 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.
- Count all the pieces in each store. The winner is the player with the most pieces.
This solver to check the best move to win the game.
- open your console and cd to directory /target
- run command java -jar mancala.jar
- you are the player2, and put the index number to scoop eggs
- Enjoy!
- Run State.main