![]() ![]() ![]() In other words, I think I need to remove this code: % Series of legal boards.Īnd change it so that it sets up a counter that stops at 22. Once we hit 22 moves (the max moves possible to clear the whole grid except for 1 peg), then the solution will be a success. Since it will always be this size, I figure the simplest way to find the end is to set up a counter that will count how many moves are taken place. I figured I would have to do this because the grid isn't symmetrical. I liked the idea of rotating the grid to continue to simply figure out horizontal jumps, so I changed the rotate function to rotate it's side, and added a RotateBack function to put it back into place. I want this to show any possible solution. The triangular puzzle code required that the user input what the ending table would look like, but I didn't want that. %jump(B,A) :- rotate(BR,B), horizjmp(BR,BRJ), rotate(BRJ,A). ![]() At any given time there are no more than 38 pegs on the board. How can we know for sure that no matter which way we proceed we’ll never be able to end up in the winning position In this case we can make the following rough estimate: Any peg can move in 4 directions or less. Jump(B,A) :- rotate(B,BR), horizjmp(BR,BRJ), rotateBack(A,BRJ). The game is insolvable Let’s take a moment to reect here. Here's what I've got currently: % Legal jumps along a line. The problem I think I'm facing is trying to figure out how to let the program know it completed the puzzle. I'm trying to convert this code for solving a triangular peg solitaire puzzle into solving a rectangular peg solitaire puzzle. 3.1K Share Save 511K views 10 years ago Recreational Mathematics This is an easily remembered solution to the classic English peg or marble solitaire puzzle (Brainvita). Amaze your friends with your skill One watching of. Possible quick question here since I'm new to Prolog. This is an easily remembered solution to the classic English peg or marble solitaire puzzle (Brainvita). ![]()
0 Comments
Leave a Reply. |