Its hole is in the middle of the board. Hence no peg can jump, because there are no two pegs in a row, column, or diagonal such that one can jump over the other into the hole. A player who discovers a dead-end configuration must stop or backtrack by undoing moves and trying alternatives. Develop a representation for triangular Solitaire boards. Develop a data representation for peg moves.
Pegs can move along a row, a column, and a diagonal.
Still, develop the data definition independently of such constraints. Develop a function that, given a board and the board position of a peg, determines whether or not the peg can jump. We call such a peg enabled . Develop a function that, given a board and the board position of an enabled peg, creates a board that represents the next configuration. Develop the function solitaire , which solves a Solitaire problem for different sizes of the equilateral triangle.