05-22-2012, 08:41 AM
That's not recursive at all.
This would be recursive (clearly I must have no life):
This would be recursive (clearly I must have no life):
Code:
void main ()
{
bool dontUnderstandSomething = false;
int freeTime = ????;
int timeTaken = 0;
Subject subjectIDontUnderstand;
//time variable, keep track of current time, keep updating it in a loop
//if time = 8 A.M. set freeTime and call NewDay()
}
void NewDay ()
{
ReadArticlesOnTopic(NewInterestingTopic());
}
void ReadArticlesOnTopic ()
{
ReadLine();
dontUnderstandSomething = ReadLine.Understand;
timeTaken = ReadLine.Time;
freeTime -= timeTaken;
if (freeTime <= 0)
{
}
else if (dontUnderstandSomething == true)
{
subjectIDontUnderstand = ReadLine.Subject;
ReadArticlesOnThat(subjectIDontUnderstand);
}
else
{
ReadArticlesOnTopic(NewInterestingTopic());
}
}
Subject NewInterestingTopic ()
{
//generate a new random interesting topic
//check if topic is in index, jump back to line 1 if it has, else continue
//store topic in index
//return topic
}