private void EqFormat(int temp,string op)
{
switch(displayMode){
case 0: //arithmetic
switch(op){
case "+":
if((solution - temp)<0){
temp = Random.Range(0,solution);
}
equation = (solution-temp) + " + " + temp + " = ?";
break;
case "-":
equation = (temp+solution) + " - " + temp + " = ?";
break;
case "x":
while(true){
if(solution%temp==0) break;
temp = Random.Range(1,9);
}
equation = (solution/temp) + " * " + temp + " = ?";
break;
case "/":
equation = (temp*solution) + " / " + temp + " = ?";
break;
default: //wtf
break;
}
break;
case 1: //algebra
switch(op){
case "+":
equation = " ? + " + temp + " = " + (solution+temp);
break;
case "-":
if(solution >= temp){
equation = "? - " + temp + " = " + (solution-temp);
}
else{
equation = temp + " - ? = " + (temp-solution);
}
break;
case "x":
if(temp<1) temp = (int)Random.Range(1,9);
switch((int)Random.Range(0,2)){
case 0:
equation = temp + " * ? = " + (temp*solution);
break;
case 1:
case 2:
equation = "? * " + temp + " = " + (temp*solution);
break;
default:
break;
}
break;
case "/":
equation = (temp*solution) + " / ? = " + temp;
break;
default: //wtf
break;
}
break;
case 2: //mixed
displayMode = Random.Range(0,2);
EqFormat(temp,op);
break;
default: //wtf
break;
}
}