[Solved] trying to fix this method in my class to, I think maybe try-catch, but the goal is to make the user only be able to enter 1-9


There are a few mistakes in your logic. Let’s try this:

public int move() {  // make it so they can only choose 1-9
    System.out.print("Where do you want to move? ");
    Scanner in = new Scanner(System.in);
    int move = in.nextInt();
    while (move < 1 || move > 9) {
         System.out.println("that move is invalid must be 1-9");
         move = in.nextInt();
    }
    return move;
}

2

solved trying to fix this method in my class to, I think maybe try-catch, but the goal is to make the user only be able to enter 1-9