Code:
for(int Non=0; Non<(sizeof(Question)/sizeof(Question[0])); Non++)
{
Iterator2=true;
while(Iterator2)
{
No = random(0,(sizeof(Question)/sizeof(Question[0])-1));
for(int Ni=0; Ni<Non; Ni++)
{
if(Question[No] == QuestionsAlreadyAsked[Ni])
continue;
else
break;
}
Iterator2=false;
}
QuestionsAlreadyAsked[Non]= Question[No];
cout<<endl<<endl;
cout<<"\t";
DelayType(Question[No], 15, false, 11);
cout<<endl;
cout<<"\t\t ";
DelayType("a)", 250, false, 15);
cout<<" ";
DelayType(OptionA[No], 50, false, 7);
cout <<endl;
and so on..
///////////////////////// Question Output /////////////////////////
Code for Answer logic here
So focus on the
Code:
Iterator2=true;
while(Iterator2)
{
No = random(0,(sizeof(Question)/sizeof(Question[0])-1));
for(int Ni=0; Ni<Non; Ni++)
{
if(Question[No] == QuestionsAlreadyAsked[Ni])
continue;
else
break;
}
Iterator2=false;
}
This is going to make it so that A question that was asked by the program previously would not be asked again. But this is not working! I have been breaking my head on this for hours I just don't get what is wrong.
The "No" variable holds the question number to be outputted, and I have to make sure No does not repeat itself and hence the While Loop, but the while loop does not seem to work as anticipated
because the same question is being printed out..