Page 1 of 1

For Jordan.

Posted: Tue Oct 11, 2011 4:58 pm
by Justin Shafer
+++ /Users/j_sparks/opendental8/src/sparks.c 2011-10-11 11:49:20.000000000 -0400
--- /Users/j_sparks/opendental8/src/sparks.c 2011-10-11 11:51:38.000000000 -0400
@@ -14,16 +14,12 @@
sleep(3600);
}

+void drink_coffee () {
+ sleep(120);
+}
+
int main (void) {
+ int hours_worked = 0, hours_slept = 0, days = 0, coffee = 0;
- int hours_worked = 0, hours_slept = 0, days = 0;
bool overload = false;

while (!overload) {
+ if (hours_worked < HRS_MAXIMUM_WORK || coffee > 0) {
- if (hours_worked < HRS_MAXIMUM_WORK) {
do_work();
hours_worked = hours_worked + 1;
}
@@ -41,10 +37,9 @@
hours_slept = 0;
}
+ else if (hours_worked > HRS_MAXIMUM_WORK) {
- else if (hours_worked + hours_slept > HRS_DAY) {
+ drink_coffee();
+ coffee = coffee + 1;
+ printf("Mmm! Delicious coffee number %d!\n",coffee);
+ hours_worked = 0;
- days = 9999;
- printf("It has been %d ... [static]\n",days);
- return 1;
}
}

Re: For Jordan.

Posted: Tue Oct 11, 2011 5:24 pm
by jordansparks
Hmm. The code is funny enough. What puzzles me is that it's also formatted as an SVN commit. Wonder where it came from.