Question: Code in C++, use functions and keep simple please. Thanks! Description: This program represents a peg jumping puzzle A move is made by a peg

Code in C++, use functions and keep simple please. Thanks!

Code in C++, use functions and keep simple please. Thanks! Description: Thisprogram represents a peg jumping puzzle A move is made by apeg jumping over another peg into an empty spot, where the jumped

Description: This program represents a peg jumping puzzle A move is made by a peg jumping over another peg into an empty spot, where the jumped peg is then removed from the board. The game ends when there are no more valid moves to make. The object is to eliminate as many pegs as possible Sample output: Welcome to the peg jump puzzle! Enter'- to exit, or 'for instructions. ABC D E F G H I J K L M TUV WX Y Z 1 2 3 4 5 6 1. Enter the peg to move: + Welcome to the peg jump puzzle. The board starts out with a single blank position, represented by the '*'. To make a move, select the letter of a peg. A peg must be able to jumpover an adjacent peg into a blank position for a move to be valid. The jumped peg is then removed from the board. The game is over when there are no valid moves left. At any point enter' to exit, or '+' for instructions. 1. Enter the peg to move: E A B C T UV W X Y Z 1 2 3 4 5 6 2. Enter the peg to move: w A B C GHWKLM TUVX Y Z 1 2 3 4 5 6 3. Enter the peg to move: 5 A B C GHWKLM T UV5 X Y Z 4. Enter the peg to move: 2 Invalid move, please retry. 4. Enter the peg to move: r A B C DF GHIWKLM NOPRS TUV5X Y Z 1 3 4 6 5. Enter the peg to move: R * 1 x 2 There is more than one possible move. Which move do you want? 1 A B C DRF GHI K L M NOPS TU V5 XYZ 1 3 4 6 6. Enter the peg to move: - Exiting.. 27 pieces remaining. Ouch! Description: This program represents a peg jumping puzzle A move is made by a peg jumping over another peg into an empty spot, where the jumped peg is then removed from the board. The game ends when there are no more valid moves to make. The object is to eliminate as many pegs as possible Sample output: Welcome to the peg jump puzzle! Enter'- to exit, or 'for instructions. ABC D E F G H I J K L M TUV WX Y Z 1 2 3 4 5 6 1. Enter the peg to move: + Welcome to the peg jump puzzle. The board starts out with a single blank position, represented by the '*'. To make a move, select the letter of a peg. A peg must be able to jumpover an adjacent peg into a blank position for a move to be valid. The jumped peg is then removed from the board. The game is over when there are no valid moves left. At any point enter' to exit, or '+' for instructions. 1. Enter the peg to move: E A B C T UV W X Y Z 1 2 3 4 5 6 2. Enter the peg to move: w A B C GHWKLM TUVX Y Z 1 2 3 4 5 6 3. Enter the peg to move: 5 A B C GHWKLM T UV5 X Y Z 4. Enter the peg to move: 2 Invalid move, please retry. 4. Enter the peg to move: r A B C DF GHIWKLM NOPRS TUV5X Y Z 1 3 4 6 5. Enter the peg to move: R * 1 x 2 There is more than one possible move. Which move do you want? 1 A B C DRF GHI K L M NOPS TU V5 XYZ 1 3 4 6 6. Enter the peg to move: - Exiting.. 27 pieces remaining. Ouch

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!