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
}
"Normally if given a choice between doing something and nothing, I’d choose to do nothing. But I would do something if it helps someone else do nothing. I’d work all night if it meant nothing got done."
-Ron Swanson
"I shall be a good politician, even if it kills me. Or if it kills anyone else for that matter. "
-Mark Antony
-Ron Swanson
"I shall be a good politician, even if it kills me. Or if it kills anyone else for that matter. "
-Mark Antony