void move() {
        if (currentDirection == Direction.RIGHT) {
            if (checkIndex(i, j + 1)) {
                j++;
                arr[i][j] = currentIndex;
                currentIndex++;
            } else {
                turn();
            }
        } else if (currentDirection == Direction.DOWN) {
            if (checkIndex(i + 1, j)) {
                i++;
                arr[i][j] = currentIndex;
                currentIndex++;
            } else {
                turn();
            }
        } else if (currentDirection == Direction.LEFT) {
            if (checkIndex(i, j - 1)) {
                j--;
                arr[i][j] = currentIndex;
                currentIndex++;
            } else {
                turn();
            }
        } else if (currentDirection == Direction.UP) {
            if (checkIndex(i - 1, j)) {
                i--;
                arr[i][j] = currentIndex;
                currentIndex++;
            } else {
                turn();
            }
        }
    }