/* Copyright (c) 1979 Regents of the University of California */
* Print out a meaningful phrase depending on the time of
* Author: Robert Toxen (UCB) 7/10/78
* The following structure parameterizes the
int d_start
; /* starting hour */
char *d_mesg
; /* applicable message */
4, "You really should be home in bed",
50, "panic: time of day bug",
* The special case structure: if the hour is exactly
* one of these, print the corresponding message.
int s_time
; /* Applicable hour */
char *s_mesg
; /* Corresponding mesg */
17, "You should be eating dinner",
register struct daytime
*dp
;
register struct special
*sp
;
for (sp
= &special
[0]; sp
->s_time
!= -1; sp
++)
if (sp
->s_time
== hour
) {
printf("%s\n", sp
->s_mesg
);
for (dp
= &daytime
[0]; dp
->d_start
!= -1; dp
++)
if (hour
< (dp
+1)->d_start
) {
printf("%s\n", dp
->d_mesg
);
* Why didn't this thing print anything !?!
printf("No message for time!?!\n");