Problem solving exercise (challenging:) Write a Java class GameOfFifteen that implements the game of 15: https://en.wikipedia.org/wiki/15_puzzle The class should contain: - a public default constructor that creates a game configuration with 15 cells positioned randomly. - a public method toString() that returns the string representation of the actual configuration of the game. For example: 3 8 7 6 13 2 10 15 1 12 11 14 9 4 5 - a method public void move(int x, int y) that moves the cell at position (x,y). The coordinates range from 0 to 3, for instance, the coodrinate of "13" is (1,0) and the coordinate of "11" is (2,3). A cell can be moved if there is an empty cell on the same row or on the same column. If a given cell can not be moved, the method should do nothing. For example, if a user enters x=1 and y=2, the number at position (1,2), that is 10, should move one position to the right. The resulting configuration of the game is then: 3 8 7 6 13 2 10 15 1 12 11 14 9 4 5 You can use the following template: import static dit948.SimpleIO.*; import static dit948.Random.*; public class GameOfFifteen { // 0 indicates empty cell private final int[][] frame = new int[4][4]; public GameOfFifteen() { for (int num = 1; num <= 15; num++) randomMove(num); } private void randomMove(int num) { int x, y; do { x = randomInt(4); y = randomInt(4); } while (frame[x][y] != 0); frame[x][y] = num; } public String toString() { String result = ""; for (int x = 0; x < 4; x++) result += String.format("%2d %2d %2d %2d\n", frame[x][0], frame[x][1], frame[x][2], frame[x][3]).replace(" 0", " "); return result; } public void move(int x, int y) { tryLeft(x, y); tryRight(x, y); tryUp(x, y); tryDown(x, y); } private void tryLeft(int x, int y) { //code here } // same for tryRight, tryUp, tryDown methods public static void main(String[] args) { GameOfFifteen game = new GameOfFifteen(); do { System.out.println(game); System.out.print("Enter x: "); int x = readInt(); System.out.print("Enter y: "); int y = readInt(); game.move(x, y); } while (true); } }