Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!brutus.cs.uiuc.edu!psuvax1!rutgers!aramis.rutgers.edu!atanasoff.rutgers.edu!lou From: lou@atanasoff.rutgers.edu (Lou Steinberg) Newsgroups: comp.windows.x Subject: Re: seasonal demo follows (long) Message-ID: Date: 26 Dec 89 20:51:27 GMT References: <6591@lindy.Stanford.EDU> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 123 Cute! I revised the program to add a shamash (an additional "servant" candle, usually placed higher than the others). Here are diffs: *** hanu.c.ORIG Tue Dec 26 15:39:42 1989 --- hanu.c.NEW Tue Dec 26 15:40:01 1989 *************** *** 37,41 **** /* candle definitions and globals */ ! #define NCANDLE 8 int ncandle = NCANDLE; char candle_color[30] = "red"; --- 37,42 ---- /* candle definitions and globals */ ! #define NCANDLE 9 ! #define SHAMASH 4 /* which candle is shamash - 0 is leftmost */ int ncandle = NCANDLE; char candle_color[30] = "red"; *************** *** 153,156 **** --- 154,163 ---- } + int shoff (i) /* if candle i is shamash, extra height for */ + int i; /* shamash, else 0 */ + { + return ( (i == SHAMASH ? (height*.1) : 0) ); + } + DrawCandle () { *************** *** 162,168 **** XFillRectangle (display,window,gc, (int)((i+.5)*width/(ncandle+.5)), ! (int)(height*0.2), (int)(width/((ncandle+.5)*2)), ! (int)(height*0.4)); } /* base */ --- 169,175 ---- XFillRectangle (display,window,gc, (int)((i+.5)*width/(ncandle+.5)), ! (int)(height*0.3-shoff(i)), (int)(width/((ncandle+.5)*2)), ! (int)(height*0.4)+shoff(i)); } /* base */ *************** *** 169,173 **** XFillRectangle (display,window,gc, (int)(.5*width/(ncandle+.5)), ! (int)(height*0.6)-1, (int)(width*(1.-1./(ncandle+.5))), (int)(height*0.1)); --- 176,180 ---- XFillRectangle (display,window,gc, (int)(.5*width/(ncandle+.5)), ! (int)(height*0.7)-1, (int)(width*(1.-1./(ncandle+.5))), (int)(height*0.1)); *************** *** 174,180 **** XFillRectangle (display,window,gc, (int)((ncandle*.5)*width/(ncandle+.5)), ! (int)(height*0.7)-2, (int)(width/((ncandle+.5)*2)), ! (int)(height*0.2)); XFlush (display); } --- 181,187 ---- XFillRectangle (display,window,gc, (int)((ncandle*.5)*width/(ncandle+.5)), ! (int)(height*0.8)-2, (int)(width/((ncandle+.5)*2)), ! (int)(height*0.18)); XFlush (display); } *************** *** 189,193 **** XFillRectangle (display,window,gc, (int)((i+.5)*width/(ncandle+.5)), ! (int)(height*0.03), (int)(width/((ncandle+.5)*2)), (int)(height*0.15)); --- 196,200 ---- XFillRectangle (display,window,gc, (int)((i+.5)*width/(ncandle+.5)), ! (int)(height*0.13-shoff(i)), (int)(width/((ncandle+.5)*2)), (int)(height*0.15)); *************** *** 198,202 **** XFillRectangle (display,window,gc, (int)((i+.5)*width/(ncandle+.5)), ! (int)(height*0.03), (int)(width/((ncandle+.5)*2)), (int)(height*0.15)); --- 205,209 ---- XFillRectangle (display,window,gc, (int)((i+.5)*width/(ncandle+.5)), ! (int)(height*0.13-shoff(i)), (int)(width/((ncandle+.5)*2)), (int)(height*0.15)); *************** *** 208,212 **** XFillRectangle (display,window,gc, (int)((i+.5)*width/(ncandle+.5)), ! (int)(height*0.03), (int)(width/((ncandle+.5)*2)), (int)(height*0.05)); --- 215,219 ---- XFillRectangle (display,window,gc, (int)((i+.5)*width/(ncandle+.5)), ! (int)(height*0.13-shoff(i)), (int)(width/((ncandle+.5)*2)), (int)(height*0.05)); -- Lou Steinberg uucp: {pretty much any major site}!rutgers!aramis.rutgers.edu!lou arpa: lou@cs.rutgers.edu