So my problem is that if you want to get a new calculation, the operaotr in my array should change. How can i do that? im trying this now for hours :/ this is how far i got. so first it starts with + and whan you choose to get a new calculation the next one should be - and so on.... so i need to switch the "operator[0]"
private static void mathGame() {
char[] operator = {'+', '-', '*', '/'};
int x;
int y = 0;
Scanner input = new Scanner(System.in);
do {
int operand1 = (int) (Math.random() * (100 - 1) + 1);
int operand2 = (int) (Math.random() * (100 - 1) + 1);
System.out.println("Solve");
System.out.println(operand1 + " " + operator[0] + " " + operand2);
x = input.nextInt();
// operator [1]++;
if (x == evaluate(operand1, operator[0], operand2)) {
System.out.println("True!");
System.out.println("New Challange?");
y = input.nextInt();
//operator[1]++;
} else if (x != evaluate(operand1, operator[0], operand2)) {
System.out.println("False!");
System.out.println("New Challange?");
y = input.nextInt();
//operator[1]++;
}
} while (y == 1);
}