package longestpath;import java.util.Scanner;import ui.LabyrinthUserInterface;import ui.UserInterfaceFactory;import ui.UIAuxiliaryMethods;class Coordinate{ int x,y; Coordinate(){ x=0; y=0; } Coordinate(int x,int y){ this.x=x; this.y=y; } boolean equals(Coordinate n){ return (n.x==this.x&&n.y==this.y); }}class CoordinateRow{ static final int MAX_NUMBER_OF_ELEMENTS=24*32; Coordinate array; int numberOfElements; CoordinateRow(){ array=new CoordinateMAX_NUMBER_OF_ELEMENTS; numberOfElements=0; } void addCoordinate(Coordinate n){ arraynumberOfElements=n; numberOfElements+=1; } void removeCoordinate(){ numberOfElements-=1; }}public class Longestpath { static final int WIDTH=32; static final int HEIGHT=24; static final int WEST=0; static final int SOUTH=1; static final int EAST=2; static final int NORTH=3; static final int WAITING_TIME=10; int maximum=0; CoordinateRow wall=new CoordinateRow(); CoordinateRow path=new CoordinateRow(); CoordinateRow longestPath=new CoordinateRow(); Coordinate nextStep=new Coordinate(); Coordinate startPosition=new Coordinate(); Coordinate endPosition=new Coordinate(); LabyrinthUserInterface ui; Longestpath(){ ui = UserInterfaceFactory.getLabyrinthUI(WIDTH, HEIGHT); UIAuxiliaryMethods.askUserForInput(); }   void processLevel(Scanner in){ in.useDelimiter(“=”); while(in.hasNext()){ Scanner readStartPosition=new Scanner(in.next()); startPosition=readPosition(readStartPosition); path.addCoordinate(startPosition); Scanner readEndPosition=new Scanner(in.next()); endPosition=readPosition(readEndPosition); Scanner wallPositions=new Scanner(in.next()); createWall(wallPositions); } initializeLevel(); } Coordinate readPosition(Scanner in){ Coordinate result=new Coordinate(in.nextInt(),in.nextInt()); return result; } void createWall(Scanner in) {        while(in.hasNext()) {                wall.addCoordinate(new Coordinate(in.nextInt(),in.nextInt()));        }} void initializeLevel(){ for(int i=0;imaximum){ maximum=path.numberOfElements; longestPath.numberOfElements=path.numberOfElements; for(int i=0;i