Lazy Day, Busy Day Algorithm


void lazyDay(){
	while(! TimeToSleep){
		eat();
		watchTV();
		listenMusic(Psych mood);
		nap();		
		surfInternet();
		trySomeTweaksOnUbuntu();	
	}	
	sleep();
}

void busyDay(bool haveTest, Queue jobs){
	if(haveTest()){
		study();	
	}
	
	Job current;
	while(!jobs.empty()){
		current = jobs.dequeue();
		if(current == "class"){
			try{
				goToClass();		
			}
			catch(NotFeelingWellException e){
				writeLeaveLetter();
			}	
		}
		else if(current == "work"){
			try{
				goToWork();
			}
			catch(NotFeelingWellException e){
				findSubstitute();
			}
		}
	}
}

Advertisements

One thought on “Lazy Day, Busy Day Algorithm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s