A peg solitaire simulator. Inputs are:
Outputs are:
If the x/y coordinates are outside of the usable grid, or does not contain a peg, the state stays the same.
Starting state of the board:
0 1 2 3 4 5 6
0 x x x
1 x x x
2 x x x x x x x
3 x x x 0 x x x
4 x x x x x x x
5 x x x
6 x x x
Create a player, try to clear the board by taking other pieces.
Read the rules of peg solitaire online: https://en.wikipedia.org/wiki/Peg_solitaire
We use the English rules, as is proper.
The solitaire game outputs the number of remaining pieces on the board.
Your goal is to get to one remaining piece.
# | Input | Output | Bidirectional |
---|---|---|---|
0 | x coordinate of peg to move - bit 0 | remaining piece count - bit 0 | |
1 | x coordinate of peg to move - bit 1 | remaining piece count - bit 1 | |
2 | x coordinate of peg to move - bit 2 | remaining piece count - bit 2 | |
3 | y coordinate of peg to move - bit 0 | remaining piece count - bit 3 | |
4 | y coordinate of peg to move - bit 1 | remaining piece count - bit 4 | |
5 | y coordinate of peg to move - bit 2 | remaining piece count - bit 5 | |
6 | direction to move peg in - bit 0 | game over bit | |
7 | direction to move peg in - bit 1 |