hi i am making a math game targeted at kids using reactivision and processing.
i want there to be several questions generated randomly and once they have answered correctly a new question is generated. i have tried using this loop but the program keeps looping the for loop and it never actually exits the loop. the code is below.
////////Level 1 Game State
public void easyMode(){
float obj_size = object_size*scale_factor;
// float cur_size = cursor_size*scale_factor;
ArrayList<TuioObject> tuioObjectList = tuioClient.getTuioObjectList();
for (int i=0;i<tuioObjectList.size();i++) {
TuioObject tobj = tuioObjectList.get(i);
background(255);
//int eNum1 = (int)(Math.random() *10);
int q=0;
int eAnswer;
int countE= 2;
//text("Time in secs: "+str(s.time()/1000.0), 50, 100);
//fill(0);
eAnswer = eNum1 + eNum2;
for (q = 0; q < countE; q++){
//while(q<countE){
fill(200);
text("what is " + eNum1 + " + " + eNum2 + " ? ", 500, 500);
if (tobj.getSymbolID()==eAnswer){
print(q);
text("great, the answer is " + eAnswer, 100,100);
fill(255);
// q= q+1;
eNum1 = (int)(Math.random() *10);
eNum2 = (int)(Math.random() *10);
}
else if(tobj.getSymbolID()!=eAnswer){
text("That is the incorrect answer, please try again",100,100 );
}
else if(q==countE){
background(#E04848);
text("finished", 800, 900);
}
}
}
}