Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA PROGRAMMING LANGUAGE!!! : Program Description: You have been given 3 sliding puzzles that are shuffled around. All three puzzles are of different size 3
JAVA PROGRAMMING LANGUAGE!!! :
Program Description: You have been given sliding puzzles that are shuffled around. All three
puzzles are of different size After you solve all the puzzles you decide you want
to make these puzzles into a program. The puzzles are located in separate files
and The program should allow users to choose the puzzle they want to
solve, load the puzzle from the provided files, and solve the puzzle using the console.
Solved Puzzles:
Task
Create methods fileReader and puzzleSelector: One will ask the user for which puzzle and a
second which reads the file contents and build a twodimensional array. Make sure these
methods return the array,
Task
Create a print method which prints the array out in its current state. Make sure that it is printed
like the following:
Task
Create a method that will check if the puzzle is correctly solved. This can be done by comparing
the array against a solved array. It should return true if solved.
Task
Create a method for users to solve the puzzle. It should take in a user input of what piece you
want to slide into the empty slot. It should check if it has been solved after every step. After you
solve it return to the menu.
Task
Create a method which prints all unsolved puzzles.
Task
Create a menu function that has the following options.
Exit
Print unsolved puzzles
Solve Puzzle
The main method should only call on the menu method. All other functionality should come
from method calls. Remember that a method should only do one thing. You should also not write
the same code multiple times, as you can call a method instead.
File Edit View
File Edit View
File Edit View
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started