+++ /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;
}
}
For Jordan.
- Justin Shafer
- Posts: 596
- Joined: Sat Jul 28, 2007 7:34 pm
- Location: Fort Worth, TX.
For Jordan.
Justin Shafer
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
Onsite Dental Systems
817-909-4222
justin@onsitedentalsystems.com
http://www.onsitedentalsystems.com
http://iocsnapshot.com
http://justinshafer.blogspot.com
- jordansparks
- Site Admin
- Posts: 5770
- Joined: Sun Jun 17, 2007 3:59 pm
- Location: Salem, Oregon
- Contact:
Re: For Jordan.
Hmm. The code is funny enough. What puzzles me is that it's also formatted as an SVN commit. Wonder where it came from.
Jordan Sparks, DMD
http://www.opendental.com
http://www.opendental.com