After every move the number of covered A positions increases or decreases by one, and the same for the number of covered B positions and the number of covered C positions. Initially with only the central position free, the number of covered A positions is 12, the number of covered B positions is 12, and also the number of covered C positions is 12. Divide the positions of the board into A, B and C positions as follows: This is easily seen as follows, by an argument from Hans Zantema. There is no solution to the European board with the initial hole centrally located, if only orthogonal moves are permitted. On the English board the equivalent alternative games are to start with a hole and end with a peg at the same position. This mirror image notation is used, amongst other reasons, since on the European board, one set of alternative games is to start with a hole at some position and to end with a single peg in its mirrored position. There are many different solutions to the standard problem, and one notation used to describe them assigns letters to the holes: On an English board, the first three moves might be: Thus valid moves in each of the four orthogonal directions are: A blue ¤ is the hole the current peg moved from a red * is the final position of that peg, a red o is the hole of the peg that was jumped and removed.
indicates a peg in a hole, * emboldened indicates the peg to be moved, and o indicates an empty hole.
PEG SOLITAIRE JAVA CRACKER
The objective is, making valid moves, to empty the entire board except for a solitary peg in the central hole.Ī man playing triangular peg solitaire at a Cracker Barrel restaurant.Ī valid move is to jump a peg orthogonally over an adjacent peg into a hole two positions away and then to remove the jumped peg. The standard game fills the entire board with pegs except for the central hole. This is the first known reference to the game in print. The August 1697 edition of the French literary magazine Mercure galant contains a description of the board, rules and sample problems. The first evidence of the game can be traced back to the court of Louis XIV, and the specific date of 1697, with an engraving made ten years later by Claude Auguste Berey of Anne de Rohan-Chabot, Princess of Soubise, with the puzzle by her side. It is also called Brainvita in India, where sets are sold commercially under this name. The game is known as solitaire in Britain and as peg solitaire in the US where 'solitaire' is now the common name for patience. Some sets use marbles in a board with indentations. Peg solitaire, Solo Noble or simply Solitaire is a board game for one player involving movement of pegs on a board with holes. So if you can see if there's a pattern to solving squares, and apply that to your solver, that's probably the best way to go.The Princess of Soubise playing solitaire, 1697 Does it work with 4x4? And how do you put that into rules? Brute force is really going to be a nightmare. Figure out the pattern for solving a square of even and odd sides. I can see, that but basically, that's what I think you need to do. I'd advise you just work around the edge, if that's even possible.
PEG SOLITAIRE JAVA HOW TO
You can go there if you really want to, and if you can figure how to stretch pieces that far. Consider:Įverything outside of the frame of 0s in all directions is infinity. You probably need to figure out if with even or odd sides, if that matters. You basically need to figure out if there is a set pattern to take with a square, which will solve it. You're going to have to figure out rules which you can use to cull possible moves. You're supposed to write a solve for an arbitrary number of pieces, on an infinite board (meaning you can wander off in any direction)? Did you even read the Wiki link? On a + board, with a piece missing, there are a massive number of possible moves to figure out (3 million).
If I'm reading your original post again right, you're screwed.