A common puzzle involves a triangular board with 15 holes for tees/pegs as shown in the image below:
Starting with all the pegs in the board except for a hole at the top, the point of the puzzle is to jump pegs over one another like checkers in such a way to leave exactly one peg left. The only valid move is to jump one peg over an adjacent peg in any direction into an empty hole. The peg that was jumped is then removed from the board. Play finishes when there remain no valid moves.
Your job is to write a program that can find a complete solution to the peg puzzle, i.e., one that leaves exactly one peg left. There are multiple possible solutions, so your program just needs to print one.
- Your program will receive no input. You are not allowed to read data from any outside source.
- Print out the list of 13 moves that gives a result of 1 peg remaining using this format:
Peg 1 jumps Peg 3 to Hole 6.
- The holes/pegs are numbered from top to bottom, left to right, so that the top peg/hole is 1, numbering until the bottom-right is 15.
- Your program must find the solution at runtime. Printing out a solution directly by any means other than solving it in the program is an automatic disqualification.
- Bonus: receive 10 bonus points if you can output multiple unique solutions (can just print separated by blank lines).
- Bonus: receive 5 bonus points if the number
15appears nowhere in your source code.
This is code-golf, so the shortest solution (by byte count) that prints out a correct answer will be the winner. Bonus points are subtracted from your total byte count. Please provide a sample output of running your program as well as a link to
ideone or some similar site if possible demonstrating the execution of your program.