Question: In the language of your choiceC++ E define a data structure to be used to support the 8-puzzle game that we discussed in class. To

 In the language of your choiceC++ E define a data structure

In the language of your choiceC++ E define a data structure to be used to support the 8-puzzle game that we discussed in class. To demonstrate that your initial data structure works you are write a program called eighipuzzle to read in 2 game states, "start and "goal", and provide the ability to display the current state. In defining your data structure think about what you would need to be able to track a sequence of states so you can display the steps needed to arrive at the goal state. For example, the program may read the starting and goal states from standard in as two sequences of 9 numbers each: eightpuzzle 7 2 4 5-1 6 8 3 1 12345673 to represent: Start State Goal State Note -1 is used to represent the "blank" space to simplify processing. The rubric for this assignment is as follows: 1) 15 points - data structure supports 8-puzzle instance(s) 2) 15 points -program reads in both the start and goal state into the data structure defined in1. 3) 10 points -display function -program displays the start/current state in 8-puzzle form, i.e., 3x3. 4) 10 points -program is well formatted and has meaningful comments. NOTE: points for #4 are only given if the program runs correctly NOTE: Please type your written answers or make sure they are yery neatly written! In the language of your choiceC++ E define a data structure to be used to support the 8-puzzle game that we discussed in class. To demonstrate that your initial data structure works you are write a program called eighipuzzle to read in 2 game states, "start and "goal", and provide the ability to display the current state. In defining your data structure think about what you would need to be able to track a sequence of states so you can display the steps needed to arrive at the goal state. For example, the program may read the starting and goal states from standard in as two sequences of 9 numbers each: eightpuzzle 7 2 4 5-1 6 8 3 1 12345673 to represent: Start State Goal State Note -1 is used to represent the "blank" space to simplify processing. The rubric for this assignment is as follows: 1) 15 points - data structure supports 8-puzzle instance(s) 2) 15 points -program reads in both the start and goal state into the data structure defined in1. 3) 10 points -display function -program displays the start/current state in 8-puzzle form, i.e., 3x3. 4) 10 points -program is well formatted and has meaningful comments. NOTE: points for #4 are only given if the program runs correctly NOTE: Please type your written answers or make sure they are yery neatly written

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!