Question: In the C language, define a data structure to be used to support the 8-puzzle game that we discussed in class. To demonstrate that your

In the C language, 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 eightpuzzle 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.

In the C language, define a data structure to be used to

For example, the program may read the starting and goal states from standard in as two sequences of 9 numbers each: eightpuzzle 7 245-16 83 1 -1 12345678 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 in 1. 3) 10 points - display function - program displays the start/current state in 8-puzzle form, i.e., 3 x3 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 very neatly writtern! For example, the program may read the starting and goal states from standard in as two sequences of 9 numbers each: eightpuzzle 7 245-16 83 1 -1 12345678 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 in 1. 3) 10 points - display function - program displays the start/current state in 8-puzzle form, i.e., 3 x3 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 very neatly writtern

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!