I'm trying to add a retry button in a mini quiz game, that reshow the view (question generator), but I want to exclude the last answered question from the random generator
-(IBAction)continueQuestion:(id)sender{
[self startQuestions];
}
This code doesn't work though my questions are like this
switch (questionNumber) {
case 0:
questionText.text=[NSString stringWithFormat:@"Question 1"];
rightAnswer=8;
break;
case 1:
questionText.text=[NSString stringWithFormat:@"Question 2"];
rightAnswer=64;
break;
case 2:
questionText.text=[NSString stringWithFormat:@"Question 3"];
rightAnswer= 10.2;
break;
default:
break;}
}
}
- (void)viewDidLoad{
questionNumber=arc4random() %3;
[self startQuestions];}
So for example if Question 1 was asked and answered, I want it not to be included in the random generation of the next question
Thanks,