Home / Expert Answers / Computer Science / the-triangle-puzzle-is-played-with-fourteen-pegs-and-a-board-the-board-has-fifteen-holes-drilled-in-pa759

(Solved): The triangle puzzle is played with fourteen pegs and a board. The board has fifteen holes drilled in ...



The triangle puzzle is played with fourteen pegs and a board. The board has fifteen holes drilled in it in the following triangular pattern:
?
? ?
? ? ?
? ? ? ?
? ? ? ? ?
Initially, there is a peg in fourteen of the fifteen holes. The player then proceeds to repeatedly jump one peg over another, each time removing the peg that has been jumped. A jump must always be in a straight line, and only one peg can be jumped at a time. The object of the game is to finish with only one peg in the board.
Write a Prolog program which solves this problem, using a depth-first search strategy.
Question



We have an Answer from Expert

View Expert Answer

Expert Answer


Answer :- Each state is a four-tuple , where each element is either n or f to indicate if the farmer, wolf, goat or cabbage is on the near or far side of the river. The initial state is . A state is a goal iff it is the state
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe