Project Consists Writing Two Programs One C One Java Programs Implement Solutions Puzzle U Q43781929
This project consists of writing two programs, one in C++ andone in Java. Both programs will implement solutions of a puzzleusing recursive search. The puzzle is known by several names, oneof which is Hi Q. The puzzle consists of a game board with a set ofholes and a set of pegs placed in the holes. There are severalvariations in the shape of the board. For this problem, we will usethe triangular version. The board is illustrated below: The shadedcircles represent holes with pegs and the unshaded circle is a holewithout a peg. Moves are made by jumping pegs over other pegs.Using the hole numbering scheme illustrated above,, we can describemoves as triples of numbers (from, over, into) so that (0, 2, 5)means remove the peg from hole, jump over hole 2 and into hole 5.The peg that was jumped over, in hole 2, is removed. The startingconfiguration of the puzzle has one empty hole, all the other holeshave pegs. The from, over and into holes must be next to each otherin a straight line, horizontally or diagonaly. In the startingconfiguration diagramed above, the legal moves are: (0, 2, 5) (14,9, 5) (3, 4, 5) (12, 8, 5) There are various ways to represent thispuzzle in a program. One simple way is to just use a onedimensional array, and list all possible moves as a list of (from,over, into) triples. For a possible move o be legal, the from andover holes must contain pegs, and the into hole must be empty.Moves are made until no more moves are possible.The goal of thepuzzle is to leave the fewest number of pegs when the moves runout. The best case is to be left with only one peg. Your programsshould allow the user to specify which hole to leave empty at thestart, and the maximum number of pegs that can be left at te end tobe an acceptable solution. then find and print a a solution thatleaves that number of pegs. After printing a solution, allow theuser the option of asking for a better solution. If the use asksfor a better solution, only print a solution if it contains lesspegs left than the last solution, or if it has only one peg left.Solutions can be printed as a list of from, over and into holenumbers.
Expert Answer
Answer to This project consists of writing two programs, one in C++ and one in Java. Both programs will implement solutions of a p…
OR