private NPuzzleState slideLeft() { int[][] copyOfLayout = TwoDArrayUtils.makeCopy(layout); swapWithEmpty(copyOfLayout, (int) emptySpace.getX() + 1, (int) emptySpace.getY()); return new NPuzzleState(copyOfLayout, n); }
private void findCoordinatesOfEmptySpace() { emptySpace = TwoDArrayUtils.findValue(layout, EMPTY_SPACE); }