Triangle peg solitaire solution6/18/2023 % implement peg indexing by (I,J) position in triangular lists Var(J) % if index is known in advance, do deterministic search % select/4 except it exposes the index of the replacement Wish there was a built-in for doing swap_list below (or am I missing it?). Swi-Prolog, no libraries, simple output format since none was specified. Please comment with suggestions for future challenges or improvements to the format. Can you do it in Logtalk, CHR, Mercury, Picat, Curry, miniKanren, ASP or something else?Ĭhallenge 1 - Stack Based Calculator Challenge 2 - General Fizzbuzz Challenge 3 - Wolf, Goat and Cabbage Problem Challenge 4 - Luhn Algorithm Challenge 5 - Sum to 100 Challenge 6 - 15 Puzzle Solver Challenge 7 - 15 Puzzle Game Implementation Challenge 8 - Hidato Challenge 9 - Trapping Rain Water Challenge 10 - Maze generation Challenge 11 - The Game of Pig Challenge 12 - Conway's Game of Life Challenge 13 - Rock paper scissors Challenge 14 - Monty Hall problem Challenge 15 - Tic-tac-toe Challenge 16 - Longest common prefix Challenge 17 - Merge sort Challenge 18 - Closest pair problem Challenge 19 - Topological sort Challenge 20 - Poker hand analyser Challenge 21 - Greed Challenge 22 - Nim game Challenge 23 - Base64 encoding and decoding Challenge 24 - Sum and Product Puzzle Solutions in non-Prolog logic programming languages are most welcome. Your task is to display a sequence of moves (jumps) starting from the position with pegs (tees?) in all holes except hole 1 and ending with a position with only one remaining peg. Peg #1 is the top centre through to the bottom row which are pegs 11 through to 15. The fewer tees left, the higher the IQ score. This puzzle is typically seen at Cracker Barrel (a USA sales store) where one tee is missing and the remaining tees jump over each other (with removal of the jumped tee, like checkers) until one tee is left. It's a variant of peg solitaire that is small enough to be solved brute force quite easily.Īn IQ Puzzle is a triangle of 15 golf tees. Another one cribbed from Rosetta Code: Solve triangle solitaire puzzle.
0 Comments
Leave a Reply. |