1 /******************************************************************************/
3 /* December 1989 Larry Bartz Indianapolis, IN */
6 /* I'm dreaming of an ascii character-based monochrome Christmas, */
7 /* Just like the one's I used to know! */
8 /* Via a full duplex communications channel, */
9 /* At 9600 bits per second, */
10 /* Even though it's kinda slow. */
12 /* I'm dreaming of an ascii character-based monochrome Christmas, */
13 /* With ev'ry C program I write! */
14 /* May your screen be merry and bright! */
15 /* And may all your Christmases be amber or green, */
16 /* (for reduced eyestrain and improved visibility)! */
24 /* Feel free to modify the defined string FROMWHO to reflect you, your */
25 /* organization, your site, whatever. */
27 /* This really looks a lot better if you can turn off your cursor before */
28 /* execution. I wanted to do that here but very few termcap entries or */
29 /* terminfo definitions have the appropriate string defined. If you know */
30 /* the string(s) for the terminal(s) you use or which your site supports, */
31 /* you could call asciixmas from within a shell in which you issue the */
32 /* string to the terminal. The cursor is distracting but it doesn't really */
35 /* At our site, we invoke this for our users just after login and the */
36 /* determination of terminal type. */
41 /* I wrote this using only the very simplest curses functions so that it */
42 /* might be the most portable. I was personally able to test on five */
43 /* different cpu/UNIX combinations. */
50 /* cc -O asciixmas.c -lcurses -o asciixmas -s */
53 /* Zilog S8000 models 11, 21, 31, etc with ZEUS variant of SYSTEM III */
54 /* maybe other SYSTEM III also: */
56 /* cc asciixmas.c -lcurses -ltermlib -o asciixmas -s */
58 /* as above with optional "peephole optimizer" installed: */
60 /* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */
63 /* Zilog S8000 models 32, 130 with WE32100 chip and SYS V, REL2 */
66 /* cc -f -O -K sd asciixmas.c -lcurses -o asciixmas -s */
69 /* Pyramid, Sequent, any other "dual universe" types compile and execute */
70 /* under either universe. The compile line for the ucb universe (as you */
71 /* might expect) is the same as for SYS III UNIX: */
73 /* cc -O asciixmas.c -lcurses -ltermlib -o asciixmas -s */
75 /* The above compile will also hold true for other BSD systems. (I hope) */
80 /* For the Scrooges out there among you who don't want this thing to loop */
81 /* forever (or until the user hits a key), insert this into your compile */
82 /* line just after "cc" : */
88 /* cc -DNOLOOP -O asciixmas.c -lcurses -o asciixmas -s */
92 /******************************************************************************/
95 * $Id: xmas.c,v 1.19 2002/06/29 23:32:18 tom Exp $
97 #include <test.priv.h>
99 #define FROMWHO "Mark Hessling - (M.Hessling@gu.edu.au)"
101 static int my_bg
= COLOR_BLACK
;
102 static int y_pos
, x_pos
;
104 static WINDOW
*treescrn
;
105 static WINDOW
*treescrn2
;
106 static WINDOW
*treescrn3
;
107 static WINDOW
*treescrn4
;
108 static WINDOW
*treescrn5
;
109 static WINDOW
*treescrn6
;
110 static WINDOW
*treescrn7
;
111 static WINDOW
*treescrn8
;
112 static WINDOW
*dotdeer0
;
113 static WINDOW
*stardeer0
;
114 static WINDOW
*lildeer0
;
115 static WINDOW
*lildeer1
;
116 static WINDOW
*lildeer2
;
117 static WINDOW
*lildeer3
;
118 static WINDOW
*middeer0
;
119 static WINDOW
*middeer1
;
120 static WINDOW
*middeer2
;
121 static WINDOW
*middeer3
;
122 static WINDOW
*bigdeer0
;
123 static WINDOW
*bigdeer1
;
124 static WINDOW
*bigdeer2
;
125 static WINDOW
*bigdeer3
;
126 static WINDOW
*bigdeer4
;
127 static WINDOW
*lookdeer0
;
128 static WINDOW
*lookdeer1
;
129 static WINDOW
*lookdeer2
;
130 static WINDOW
*lookdeer3
;
131 static WINDOW
*lookdeer4
;
132 static WINDOW
*w_holiday
;
133 static WINDOW
*w_del_msg
;
135 static int boxit(void);
136 static int seas(void);
137 static int greet(void);
138 static int fromwho(void);
139 static int tree(void);
140 static int balls(void);
141 static int star(void);
142 static int strng1(void);
143 static int strng2(void);
144 static int strng3(void);
145 static int strng4(void);
146 static int strng5(void);
147 static int reindeer(void);
148 static int blinkit(void);
150 static RETSIGTYPE
done(int sig
) GCC_NORETURN
;
153 set_color(WINDOW
*win
, chtype color
)
159 pairs
= (bool *) calloc(COLORS
+ 1, sizeof(bool));
161 init_pair(n
, color
, my_bg
);
164 wattroff(win
, A_COLOR
);
165 wattron(win
, COLOR_PAIR(n
));
170 unset_color(WINDOW
*win
)
173 wattrset(win
, COLOR_PAIR(0));
180 if (getch() != ERR
) {
187 main(int argc GCC_UNUSED
, char **argv GCC_UNUSED
)
191 setlocale(LC_ALL
, "");
197 signal(SIGINT
, done
);
198 signal(SIGTERM
, done
);
199 #if !defined DOS && !defined OS2
200 signal(SIGHUP
, done
);
201 signal(SIGQUIT
, done
);
205 #if HAVE_USE_DEFAULT_COLORS
206 if (use_default_colors() == OK
)
212 treescrn
= newwin(16, 27, 3, 53);
213 treescrn2
= newwin(16, 27, 3, 53);
214 treescrn3
= newwin(16, 27, 3, 53);
215 treescrn4
= newwin(16, 27, 3, 53);
216 treescrn5
= newwin(16, 27, 3, 53);
217 treescrn6
= newwin(16, 27, 3, 53);
218 treescrn7
= newwin(16, 27, 3, 53);
219 treescrn8
= newwin(16, 27, 3, 53);
221 dotdeer0
= newwin(3, 71, 0, 8);
223 stardeer0
= newwin(4, 56, 0, 8);
225 lildeer0
= newwin(7, 53, 0, 8);
226 lildeer1
= newwin(2, 4, 0, 0);
227 lildeer2
= newwin(2, 4, 0, 0);
228 lildeer3
= newwin(2, 4, 0, 0);
230 middeer0
= newwin(15, 42, 0, 8);
231 middeer1
= newwin(3, 7, 0, 0);
232 middeer2
= newwin(3, 7, 0, 0);
233 middeer3
= newwin(3, 7, 0, 0);
235 bigdeer0
= newwin(10, 23, 0, 0);
236 bigdeer1
= newwin(10, 23, 0, 0);
237 bigdeer2
= newwin(10, 23, 0, 0);
238 bigdeer3
= newwin(10, 23, 0, 0);
239 bigdeer4
= newwin(10, 23, 0, 0);
241 lookdeer0
= newwin(10, 25, 0, 0);
242 lookdeer1
= newwin(10, 25, 0, 0);
243 lookdeer2
= newwin(10, 25, 0, 0);
244 lookdeer3
= newwin(10, 25, 0, 0);
245 lookdeer4
= newwin(10, 25, 0, 0);
247 w_holiday
= newwin(1, 26, 3, 27);
249 w_del_msg
= newwin(1, 19, 23, 60);
251 mvwaddstr(w_del_msg
, 0, 0, "Hit any key to quit");
253 mvwaddstr(w_holiday
, 0, 0, "H A P P Y H O L I D A Y S");
255 /* set up the windows for our various reindeer */
258 mvwaddch(lildeer1
, 0, 0, (chtype
) 'V');
259 mvwaddch(lildeer1
, 1, 0, (chtype
) '@');
260 mvwaddch(lildeer1
, 1, 1, (chtype
) '<');
261 mvwaddch(lildeer1
, 1, 2, (chtype
) '>');
262 mvwaddch(lildeer1
, 1, 3, (chtype
) '~');
265 mvwaddch(lildeer2
, 0, 0, (chtype
) 'V');
266 mvwaddch(lildeer2
, 1, 0, (chtype
) '@');
267 mvwaddch(lildeer2
, 1, 1, (chtype
) '|');
268 mvwaddch(lildeer2
, 1, 2, (chtype
) '|');
269 mvwaddch(lildeer2
, 1, 3, (chtype
) '~');
272 mvwaddch(lildeer3
, 0, 0, (chtype
) 'V');
273 mvwaddch(lildeer3
, 1, 0, (chtype
) '@');
274 mvwaddch(lildeer3
, 1, 1, (chtype
) '>');
275 mvwaddch(lildeer3
, 1, 2, (chtype
) '<');
276 mvwaddch(lildeer2
, 1, 3, (chtype
) '~');
279 mvwaddch(middeer1
, 0, 2, (chtype
) 'y');
280 mvwaddch(middeer1
, 0, 3, (chtype
) 'y');
281 mvwaddch(middeer1
, 1, 2, (chtype
) '0');
282 mvwaddch(middeer1
, 1, 3, (chtype
) '(');
283 mvwaddch(middeer1
, 1, 4, (chtype
) '=');
284 mvwaddch(middeer1
, 1, 5, (chtype
) ')');
285 mvwaddch(middeer1
, 1, 6, (chtype
) '~');
286 mvwaddch(middeer1
, 2, 3, (chtype
) '\\');
287 mvwaddch(middeer1
, 2, 4, (chtype
) '/');
290 mvwaddch(middeer2
, 0, 2, (chtype
) 'y');
291 mvwaddch(middeer2
, 0, 3, (chtype
) 'y');
292 mvwaddch(middeer2
, 1, 2, (chtype
) '0');
293 mvwaddch(middeer2
, 1, 3, (chtype
) '(');
294 mvwaddch(middeer2
, 1, 4, (chtype
) '=');
295 mvwaddch(middeer2
, 1, 5, (chtype
) ')');
296 mvwaddch(middeer2
, 1, 6, (chtype
) '~');
297 mvwaddch(middeer2
, 2, 3, (chtype
) '|');
298 mvwaddch(middeer2
, 2, 5, (chtype
) '|');
301 mvwaddch(middeer3
, 0, 2, (chtype
) 'y');
302 mvwaddch(middeer3
, 0, 3, (chtype
) 'y');
303 mvwaddch(middeer3
, 1, 2, (chtype
) '0');
304 mvwaddch(middeer3
, 1, 3, (chtype
) '(');
305 mvwaddch(middeer3
, 1, 4, (chtype
) '=');
306 mvwaddch(middeer3
, 1, 5, (chtype
) ')');
307 mvwaddch(middeer3
, 1, 6, (chtype
) '~');
308 mvwaddch(middeer3
, 2, 2, (chtype
) '/');
309 mvwaddch(middeer3
, 2, 6, (chtype
) '\\');
312 mvwaddch(bigdeer1
, 0, 17, (chtype
) '\\');
313 mvwaddch(bigdeer1
, 0, 18, (chtype
) '/');
314 mvwaddch(bigdeer1
, 0, 20, (chtype
) '\\');
315 mvwaddch(bigdeer1
, 0, 21, (chtype
) '/');
316 mvwaddch(bigdeer1
, 1, 18, (chtype
) '\\');
317 mvwaddch(bigdeer1
, 1, 20, (chtype
) '/');
318 mvwaddch(bigdeer1
, 2, 19, (chtype
) '|');
319 mvwaddch(bigdeer1
, 2, 20, (chtype
) '_');
320 mvwaddch(bigdeer1
, 3, 18, (chtype
) '/');
321 mvwaddch(bigdeer1
, 3, 19, (chtype
) '^');
322 mvwaddch(bigdeer1
, 3, 20, (chtype
) '0');
323 mvwaddch(bigdeer1
, 3, 21, (chtype
) '\\');
324 mvwaddch(bigdeer1
, 4, 17, (chtype
) '/');
325 mvwaddch(bigdeer1
, 4, 18, (chtype
) '/');
326 mvwaddch(bigdeer1
, 4, 19, (chtype
) '\\');
327 mvwaddch(bigdeer1
, 4, 22, (chtype
) '\\');
328 mvwaddstr(bigdeer1
, 5, 7, "^~~~~~~~~// ~~U");
329 mvwaddstr(bigdeer1
, 6, 7, "( \\_____( /");
330 mvwaddstr(bigdeer1
, 7, 8, "( ) /");
331 mvwaddstr(bigdeer1
, 8, 9, "\\\\ /");
332 mvwaddstr(bigdeer1
, 9, 11, "\\>/>");
335 mvwaddch(bigdeer2
, 0, 17, (chtype
) '\\');
336 mvwaddch(bigdeer2
, 0, 18, (chtype
) '/');
337 mvwaddch(bigdeer2
, 0, 20, (chtype
) '\\');
338 mvwaddch(bigdeer2
, 0, 21, (chtype
) '/');
339 mvwaddch(bigdeer2
, 1, 18, (chtype
) '\\');
340 mvwaddch(bigdeer2
, 1, 20, (chtype
) '/');
341 mvwaddch(bigdeer2
, 2, 19, (chtype
) '|');
342 mvwaddch(bigdeer2
, 2, 20, (chtype
) '_');
343 mvwaddch(bigdeer2
, 3, 18, (chtype
) '/');
344 mvwaddch(bigdeer2
, 3, 19, (chtype
) '^');
345 mvwaddch(bigdeer2
, 3, 20, (chtype
) '0');
346 mvwaddch(bigdeer2
, 3, 21, (chtype
) '\\');
347 mvwaddch(bigdeer2
, 4, 17, (chtype
) '/');
348 mvwaddch(bigdeer2
, 4, 18, (chtype
) '/');
349 mvwaddch(bigdeer2
, 4, 19, (chtype
) '\\');
350 mvwaddch(bigdeer2
, 4, 22, (chtype
) '\\');
351 mvwaddstr(bigdeer2
, 5, 7, "^~~~~~~~~// ~~U");
352 mvwaddstr(bigdeer2
, 6, 7, "(( )____( /");
353 mvwaddstr(bigdeer2
, 7, 7, "( / |");
354 mvwaddstr(bigdeer2
, 8, 8, "\\/ |");
355 mvwaddstr(bigdeer2
, 9, 9, "|> |>");
358 mvwaddch(bigdeer3
, 0, 17, (chtype
) '\\');
359 mvwaddch(bigdeer3
, 0, 18, (chtype
) '/');
360 mvwaddch(bigdeer3
, 0, 20, (chtype
) '\\');
361 mvwaddch(bigdeer3
, 0, 21, (chtype
) '/');
362 mvwaddch(bigdeer3
, 1, 18, (chtype
) '\\');
363 mvwaddch(bigdeer3
, 1, 20, (chtype
) '/');
364 mvwaddch(bigdeer3
, 2, 19, (chtype
) '|');
365 mvwaddch(bigdeer3
, 2, 20, (chtype
) '_');
366 mvwaddch(bigdeer3
, 3, 18, (chtype
) '/');
367 mvwaddch(bigdeer3
, 3, 19, (chtype
) '^');
368 mvwaddch(bigdeer3
, 3, 20, (chtype
) '0');
369 mvwaddch(bigdeer3
, 3, 21, (chtype
) '\\');
370 mvwaddch(bigdeer3
, 4, 17, (chtype
) '/');
371 mvwaddch(bigdeer3
, 4, 18, (chtype
) '/');
372 mvwaddch(bigdeer3
, 4, 19, (chtype
) '\\');
373 mvwaddch(bigdeer3
, 4, 22, (chtype
) '\\');
374 mvwaddstr(bigdeer3
, 5, 7, "^~~~~~~~~// ~~U");
375 mvwaddstr(bigdeer3
, 6, 6, "( ()_____( /");
376 mvwaddstr(bigdeer3
, 7, 6, "/ / /");
377 mvwaddstr(bigdeer3
, 8, 5, "|/ \\");
378 mvwaddstr(bigdeer3
, 9, 5, "/> \\>");
381 mvwaddch(bigdeer4
, 0, 17, (chtype
) '\\');
382 mvwaddch(bigdeer4
, 0, 18, (chtype
) '/');
383 mvwaddch(bigdeer4
, 0, 20, (chtype
) '\\');
384 mvwaddch(bigdeer4
, 0, 21, (chtype
) '/');
385 mvwaddch(bigdeer4
, 1, 18, (chtype
) '\\');
386 mvwaddch(bigdeer4
, 1, 20, (chtype
) '/');
387 mvwaddch(bigdeer4
, 2, 19, (chtype
) '|');
388 mvwaddch(bigdeer4
, 2, 20, (chtype
) '_');
389 mvwaddch(bigdeer4
, 3, 18, (chtype
) '/');
390 mvwaddch(bigdeer4
, 3, 19, (chtype
) '^');
391 mvwaddch(bigdeer4
, 3, 20, (chtype
) '0');
392 mvwaddch(bigdeer4
, 3, 21, (chtype
) '\\');
393 mvwaddch(bigdeer4
, 4, 17, (chtype
) '/');
394 mvwaddch(bigdeer4
, 4, 18, (chtype
) '/');
395 mvwaddch(bigdeer4
, 4, 19, (chtype
) '\\');
396 mvwaddch(bigdeer4
, 4, 22, (chtype
) '\\');
397 mvwaddstr(bigdeer4
, 5, 7, "^~~~~~~~~// ~~U");
398 mvwaddstr(bigdeer4
, 6, 6, "( )______( /");
399 mvwaddstr(bigdeer4
, 7, 5, "(/ \\");
400 mvwaddstr(bigdeer4
, 8, 0, "v___= ----^");
403 mvwaddstr(lookdeer1
, 0, 16, "\\/ \\/");
404 mvwaddstr(lookdeer1
, 1, 17, "\\Y/ \\Y/");
405 mvwaddstr(lookdeer1
, 2, 19, "\\=/");
406 mvwaddstr(lookdeer1
, 3, 17, "^\\o o/^");
407 mvwaddstr(lookdeer1
, 4, 17, "//( )");
408 mvwaddstr(lookdeer1
, 5, 7, "^~~~~~~~~// \\O/");
409 mvwaddstr(lookdeer1
, 6, 7, "( \\_____( /");
410 mvwaddstr(lookdeer1
, 7, 8, "( ) /");
411 mvwaddstr(lookdeer1
, 8, 9, "\\\\ /");
412 mvwaddstr(lookdeer1
, 9, 11, "\\>/>");
415 mvwaddstr(lookdeer2
, 0, 16, "\\/ \\/");
416 mvwaddstr(lookdeer2
, 1, 17, "\\Y/ \\Y/");
417 mvwaddstr(lookdeer2
, 2, 19, "\\=/");
418 mvwaddstr(lookdeer2
, 3, 17, "^\\o o/^");
419 mvwaddstr(lookdeer2
, 4, 17, "//( )");
420 mvwaddstr(lookdeer2
, 5, 7, "^~~~~~~~~// \\O/");
421 mvwaddstr(lookdeer2
, 6, 7, "(( )____( /");
422 mvwaddstr(lookdeer2
, 7, 7, "( / |");
423 mvwaddstr(lookdeer2
, 8, 8, "\\/ |");
424 mvwaddstr(lookdeer2
, 9, 9, "|> |>");
427 mvwaddstr(lookdeer3
, 0, 16, "\\/ \\/");
428 mvwaddstr(lookdeer3
, 1, 17, "\\Y/ \\Y/");
429 mvwaddstr(lookdeer3
, 2, 19, "\\=/");
430 mvwaddstr(lookdeer3
, 3, 17, "^\\o o/^");
431 mvwaddstr(lookdeer3
, 4, 17, "//( )");
432 mvwaddstr(lookdeer3
, 5, 7, "^~~~~~~~~// \\O/");
433 mvwaddstr(lookdeer3
, 6, 6, "( ()_____( /");
434 mvwaddstr(lookdeer3
, 7, 6, "/ / /");
435 mvwaddstr(lookdeer3
, 8, 5, "|/ \\");
436 mvwaddstr(lookdeer3
, 9, 5, "/> \\>");
439 mvwaddstr(lookdeer4
, 0, 16, "\\/ \\/");
440 mvwaddstr(lookdeer4
, 1, 17, "\\Y/ \\Y/");
441 mvwaddstr(lookdeer4
, 2, 19, "\\=/");
442 mvwaddstr(lookdeer4
, 3, 17, "^\\o o/^");
443 mvwaddstr(lookdeer4
, 4, 17, "//( )");
444 mvwaddstr(lookdeer4
, 5, 7, "^~~~~~~~~// \\O/");
445 mvwaddstr(lookdeer4
, 6, 6, "( )______( /");
446 mvwaddstr(lookdeer4
, 7, 5, "(/ \\");
447 mvwaddstr(lookdeer4
, 8, 0, "v___= ----^");
449 /***********************************************/
451 nodelay(stdscr
, TRUE
);
487 /* set up the windows for our blinking trees */
488 /* **************************************** */
491 overlay(treescrn
, treescrn3
);
494 mvwaddch(treescrn3
, 4, 18, ' ');
495 mvwaddch(treescrn3
, 7, 6, ' ');
496 mvwaddch(treescrn3
, 8, 19, ' ');
497 mvwaddch(treescrn3
, 11, 22, ' ');
500 mvwaddch(treescrn3
, 0, 12, '*');
503 mvwaddch(treescrn3
, 3, 11, ' ');
506 mvwaddch(treescrn3
, 5, 13, ' ');
507 mvwaddch(treescrn3
, 6, 10, ' ');
510 mvwaddch(treescrn3
, 7, 16, ' ');
511 mvwaddch(treescrn3
, 7, 14, ' ');
514 mvwaddch(treescrn3
, 10, 13, ' ');
515 mvwaddch(treescrn3
, 10, 10, ' ');
516 mvwaddch(treescrn3
, 11, 8, ' ');
519 mvwaddch(treescrn3
, 11, 18, ' ');
520 mvwaddch(treescrn3
, 12, 13, ' ');
524 overlay(treescrn
, treescrn4
);
527 mvwaddch(treescrn4
, 3, 9, ' ');
528 mvwaddch(treescrn4
, 4, 16, ' ');
529 mvwaddch(treescrn4
, 7, 6, ' ');
530 mvwaddch(treescrn4
, 8, 19, ' ');
531 mvwaddch(treescrn4
, 11, 2, ' ');
532 mvwaddch(treescrn4
, 12, 23, ' ');
535 wstandout(treescrn4
);
536 mvwaddch(treescrn4
, 0, 12, '*');
537 wstandend(treescrn4
);
540 mvwaddch(treescrn4
, 3, 13, ' ');
545 mvwaddch(treescrn4
, 7, 15, ' ');
546 mvwaddch(treescrn4
, 8, 11, ' ');
549 mvwaddch(treescrn4
, 9, 16, ' ');
550 mvwaddch(treescrn4
, 10, 12, ' ');
551 mvwaddch(treescrn4
, 11, 8, ' ');
554 mvwaddch(treescrn4
, 11, 18, ' ');
555 mvwaddch(treescrn4
, 12, 14, ' ');
559 overlay(treescrn
, treescrn5
);
562 mvwaddch(treescrn5
, 3, 15, ' ');
563 mvwaddch(treescrn5
, 10, 20, ' ');
564 mvwaddch(treescrn5
, 12, 1, ' ');
567 mvwaddch(treescrn5
, 0, 12, '*');
570 mvwaddch(treescrn5
, 3, 11, ' ');
573 mvwaddch(treescrn5
, 5, 12, ' ');
576 mvwaddch(treescrn5
, 7, 14, ' ');
577 mvwaddch(treescrn5
, 8, 10, ' ');
580 mvwaddch(treescrn5
, 9, 15, ' ');
581 mvwaddch(treescrn5
, 10, 11, ' ');
582 mvwaddch(treescrn5
, 11, 7, ' ');
585 mvwaddch(treescrn5
, 11, 17, ' ');
586 mvwaddch(treescrn5
, 12, 13, ' ');
590 overlay(treescrn
, treescrn6
);
593 mvwaddch(treescrn6
, 6, 7, ' ');
594 mvwaddch(treescrn6
, 7, 18, ' ');
595 mvwaddch(treescrn6
, 10, 4, ' ');
596 mvwaddch(treescrn6
, 11, 23, ' ');
599 wstandout(treescrn6
);
600 mvwaddch(treescrn6
, 0, 12, '*');
601 wstandend(treescrn6
);
606 mvwaddch(treescrn6
, 5, 11, ' ');
609 mvwaddch(treescrn6
, 7, 13, ' ');
610 mvwaddch(treescrn6
, 8, 9, ' ');
613 mvwaddch(treescrn6
, 9, 14, ' ');
614 mvwaddch(treescrn6
, 10, 10, ' ');
615 mvwaddch(treescrn6
, 11, 6, ' ');
618 mvwaddch(treescrn6
, 11, 16, ' ');
619 mvwaddch(treescrn6
, 12, 12, ' ');
623 overlay(treescrn
, treescrn7
);
626 mvwaddch(treescrn7
, 3, 15, ' ');
627 mvwaddch(treescrn7
, 6, 7, ' ');
628 mvwaddch(treescrn7
, 7, 18, ' ');
629 mvwaddch(treescrn7
, 10, 4, ' ');
630 mvwaddch(treescrn7
, 11, 22, ' ');
633 mvwaddch(treescrn7
, 0, 12, '*');
636 mvwaddch(treescrn7
, 3, 12, ' ');
639 mvwaddch(treescrn7
, 5, 13, ' ');
640 mvwaddch(treescrn7
, 6, 9, ' ');
643 mvwaddch(treescrn7
, 7, 15, ' ');
644 mvwaddch(treescrn7
, 8, 11, ' ');
647 mvwaddch(treescrn7
, 9, 16, ' ');
648 mvwaddch(treescrn7
, 10, 12, ' ');
649 mvwaddch(treescrn7
, 11, 8, ' ');
652 mvwaddch(treescrn7
, 11, 18, ' ');
653 mvwaddch(treescrn7
, 12, 14, ' ');
663 for (loopy
= 0; loopy
< 100; loopy
++) {
735 mvaddstr(21, 13, FROMWHO
);
742 set_color(treescrn
, COLOR_GREEN
);
743 mvwaddch(treescrn
, 1, 11, (chtype
) '/');
744 mvwaddch(treescrn
, 2, 11, (chtype
) '/');
745 mvwaddch(treescrn
, 3, 10, (chtype
) '/');
746 mvwaddch(treescrn
, 4, 9, (chtype
) '/');
747 mvwaddch(treescrn
, 5, 9, (chtype
) '/');
748 mvwaddch(treescrn
, 6, 8, (chtype
) '/');
749 mvwaddch(treescrn
, 7, 7, (chtype
) '/');
750 mvwaddch(treescrn
, 8, 6, (chtype
) '/');
751 mvwaddch(treescrn
, 9, 6, (chtype
) '/');
752 mvwaddch(treescrn
, 10, 5, (chtype
) '/');
753 mvwaddch(treescrn
, 11, 3, (chtype
) '/');
754 mvwaddch(treescrn
, 12, 2, (chtype
) '/');
756 mvwaddch(treescrn
, 1, 13, (chtype
) '\\');
757 mvwaddch(treescrn
, 2, 13, (chtype
) '\\');
758 mvwaddch(treescrn
, 3, 14, (chtype
) '\\');
759 mvwaddch(treescrn
, 4, 15, (chtype
) '\\');
760 mvwaddch(treescrn
, 5, 15, (chtype
) '\\');
761 mvwaddch(treescrn
, 6, 16, (chtype
) '\\');
762 mvwaddch(treescrn
, 7, 17, (chtype
) '\\');
763 mvwaddch(treescrn
, 8, 18, (chtype
) '\\');
764 mvwaddch(treescrn
, 9, 18, (chtype
) '\\');
765 mvwaddch(treescrn
, 10, 19, (chtype
) '\\');
766 mvwaddch(treescrn
, 11, 21, (chtype
) '\\');
767 mvwaddch(treescrn
, 12, 22, (chtype
) '\\');
769 mvwaddch(treescrn
, 4, 10, (chtype
) '_');
770 mvwaddch(treescrn
, 4, 14, (chtype
) '_');
771 mvwaddch(treescrn
, 8, 7, (chtype
) '_');
772 mvwaddch(treescrn
, 8, 17, (chtype
) '_');
774 mvwaddstr(treescrn
, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
776 mvwaddstr(treescrn
, 14, 11, "| |");
777 mvwaddstr(treescrn
, 15, 11, "|_|");
779 unset_color(treescrn
);
789 overlay(treescrn
, treescrn2
);
791 set_color(treescrn2
, COLOR_BLUE
);
792 mvwaddch(treescrn2
, 3, 9, (chtype
) '@');
793 mvwaddch(treescrn2
, 3, 15, (chtype
) '@');
794 mvwaddch(treescrn2
, 4, 8, (chtype
) '@');
795 mvwaddch(treescrn2
, 4, 16, (chtype
) '@');
796 mvwaddch(treescrn2
, 5, 7, (chtype
) '@');
797 mvwaddch(treescrn2
, 5, 17, (chtype
) '@');
798 mvwaddch(treescrn2
, 7, 6, (chtype
) '@');
799 mvwaddch(treescrn2
, 7, 18, (chtype
) '@');
800 mvwaddch(treescrn2
, 8, 5, (chtype
) '@');
801 mvwaddch(treescrn2
, 8, 19, (chtype
) '@');
802 mvwaddch(treescrn2
, 10, 4, (chtype
) '@');
803 mvwaddch(treescrn2
, 10, 20, (chtype
) '@');
804 mvwaddch(treescrn2
, 11, 2, (chtype
) '@');
805 mvwaddch(treescrn2
, 11, 22, (chtype
) '@');
806 mvwaddch(treescrn2
, 12, 1, (chtype
) '@');
807 mvwaddch(treescrn2
, 12, 23, (chtype
) '@');
809 unset_color(treescrn2
);
818 wattrset(treescrn2
, A_BOLD
| A_BLINK
);
819 set_color(treescrn2
, COLOR_YELLOW
);
821 mvwaddch(treescrn2
, 0, 12, (chtype
) '*');
822 wstandend(treescrn2
);
824 unset_color(treescrn2
);
833 wattrset(treescrn2
, A_BOLD
| A_BLINK
);
834 set_color(treescrn2
, COLOR_WHITE
);
836 mvwaddch(treescrn2
, 3, 13, (chtype
) '\'');
837 mvwaddch(treescrn2
, 3, 12, (chtype
) ':');
838 mvwaddch(treescrn2
, 3, 11, (chtype
) '.');
840 wattroff(treescrn2
, A_BOLD
| A_BLINK
);
841 unset_color(treescrn2
);
851 wattrset(treescrn2
, A_BOLD
| A_BLINK
);
852 set_color(treescrn2
, COLOR_WHITE
);
854 mvwaddch(treescrn2
, 5, 14, (chtype
) '\'');
855 mvwaddch(treescrn2
, 5, 13, (chtype
) ':');
856 mvwaddch(treescrn2
, 5, 12, (chtype
) '.');
857 mvwaddch(treescrn2
, 5, 11, (chtype
) ',');
858 mvwaddch(treescrn2
, 6, 10, (chtype
) '\'');
859 mvwaddch(treescrn2
, 6, 9, (chtype
) ':');
861 wattroff(treescrn2
, A_BOLD
| A_BLINK
);
862 unset_color(treescrn2
);
872 wattrset(treescrn2
, A_BOLD
| A_BLINK
);
873 set_color(treescrn2
, COLOR_WHITE
);
875 mvwaddch(treescrn2
, 7, 16, (chtype
) '\'');
876 mvwaddch(treescrn2
, 7, 15, (chtype
) ':');
877 mvwaddch(treescrn2
, 7, 14, (chtype
) '.');
878 mvwaddch(treescrn2
, 7, 13, (chtype
) ',');
879 mvwaddch(treescrn2
, 8, 12, (chtype
) '\'');
880 mvwaddch(treescrn2
, 8, 11, (chtype
) ':');
881 mvwaddch(treescrn2
, 8, 10, (chtype
) '.');
882 mvwaddch(treescrn2
, 8, 9, (chtype
) ',');
884 wattroff(treescrn2
, A_BOLD
| A_BLINK
);
885 unset_color(treescrn2
);
895 wattrset(treescrn2
, A_BOLD
| A_BLINK
);
896 set_color(treescrn2
, COLOR_WHITE
);
898 mvwaddch(treescrn2
, 9, 17, (chtype
) '\'');
899 mvwaddch(treescrn2
, 9, 16, (chtype
) ':');
900 mvwaddch(treescrn2
, 9, 15, (chtype
) '.');
901 mvwaddch(treescrn2
, 9, 14, (chtype
) ',');
902 mvwaddch(treescrn2
, 10, 13, (chtype
) '\'');
903 mvwaddch(treescrn2
, 10, 12, (chtype
) ':');
904 mvwaddch(treescrn2
, 10, 11, (chtype
) '.');
905 mvwaddch(treescrn2
, 10, 10, (chtype
) ',');
906 mvwaddch(treescrn2
, 11, 9, (chtype
) '\'');
907 mvwaddch(treescrn2
, 11, 8, (chtype
) ':');
908 mvwaddch(treescrn2
, 11, 7, (chtype
) '.');
909 mvwaddch(treescrn2
, 11, 6, (chtype
) ',');
910 mvwaddch(treescrn2
, 12, 5, (chtype
) '\'');
912 wattroff(treescrn2
, A_BOLD
| A_BLINK
);
913 unset_color(treescrn2
);
923 wattrset(treescrn2
, A_BOLD
| A_BLINK
);
924 set_color(treescrn2
, COLOR_WHITE
);
926 mvwaddch(treescrn2
, 11, 19, (chtype
) '\'');
927 mvwaddch(treescrn2
, 11, 18, (chtype
) ':');
928 mvwaddch(treescrn2
, 11, 17, (chtype
) '.');
929 mvwaddch(treescrn2
, 11, 16, (chtype
) ',');
930 mvwaddch(treescrn2
, 12, 15, (chtype
) '\'');
931 mvwaddch(treescrn2
, 12, 14, (chtype
) ':');
932 mvwaddch(treescrn2
, 12, 13, (chtype
) '.');
933 mvwaddch(treescrn2
, 12, 12, (chtype
) ',');
935 wattroff(treescrn2
, A_BOLD
| A_BLINK
);
936 unset_color(treescrn2
);
938 /* save a fully lit tree */
939 overlay(treescrn2
, treescrn
);
959 overlay(treescrn3
, treescrn8
);
964 overlay(treescrn4
, treescrn8
);
969 overlay(treescrn5
, treescrn8
);
974 overlay(treescrn6
, treescrn8
);
979 overlay(treescrn7
, treescrn8
);
986 /*ALL ON************************************************** */
988 overlay(treescrn
, treescrn8
);
997 deer_step(WINDOW
*win
, int y
, int x
)
1001 wrefresh(w_del_msg
);
1011 for (x_pos
= 70; x_pos
> 62; x_pos
--) {
1015 for (looper
= 0; looper
< 4; looper
++) {
1016 mvwaddch(dotdeer0
, y_pos
, x_pos
, (chtype
) '.');
1018 wrefresh(w_del_msg
);
1021 wrefresh(w_del_msg
);
1028 for (; x_pos
> 50; x_pos
--) {
1029 for (looper
= 0; looper
< 4; looper
++) {
1034 mvwaddch(stardeer0
, y_pos
, x_pos
, (chtype
) '*');
1035 wrefresh(stardeer0
);
1036 wrefresh(w_del_msg
);
1038 wrefresh(stardeer0
);
1039 wrefresh(w_del_msg
);
1041 mvwaddch(dotdeer0
, y_pos
, x_pos
, (chtype
) '*');
1043 wrefresh(w_del_msg
);
1046 wrefresh(w_del_msg
);
1053 for (y_pos
= 2; y_pos
< 5; y_pos
++) {
1057 wrefresh(w_del_msg
);
1059 for (looper
= 0; looper
< 4; looper
++) {
1060 deer_step(lildeer3
, y_pos
, x_pos
);
1061 deer_step(lildeer2
, y_pos
, x_pos
);
1062 deer_step(lildeer1
, y_pos
, x_pos
);
1063 deer_step(lildeer2
, y_pos
, x_pos
);
1064 deer_step(lildeer3
, y_pos
, x_pos
);
1068 wrefresh(w_del_msg
);
1076 for (y_pos
= 5; y_pos
< 10; y_pos
++) {
1080 wrefresh(w_del_msg
);
1082 for (looper
= 0; looper
< 2; looper
++) {
1083 deer_step(middeer3
, y_pos
, x_pos
);
1084 deer_step(middeer2
, y_pos
, x_pos
);
1085 deer_step(middeer1
, y_pos
, x_pos
);
1086 deer_step(middeer2
, y_pos
, x_pos
);
1087 deer_step(middeer3
, y_pos
, x_pos
);
1091 wrefresh(w_del_msg
);
1101 for (x_pos
= 8; x_pos
< 16; x_pos
++) {
1102 deer_step(bigdeer4
, y_pos
, x_pos
);
1103 deer_step(bigdeer3
, y_pos
, x_pos
);
1104 deer_step(bigdeer2
, y_pos
, x_pos
);
1105 deer_step(bigdeer1
, y_pos
, x_pos
);
1106 deer_step(bigdeer2
, y_pos
, x_pos
);
1107 deer_step(bigdeer3
, y_pos
, x_pos
);
1108 deer_step(bigdeer4
, y_pos
, x_pos
);
1109 deer_step(bigdeer0
, y_pos
, x_pos
);
1114 for (looper
= 0; looper
< 6; looper
++) {
1115 deer_step(lookdeer4
, y_pos
, x_pos
);
1116 deer_step(lookdeer3
, y_pos
, x_pos
);
1117 deer_step(lookdeer2
, y_pos
, x_pos
);
1118 deer_step(lookdeer1
, y_pos
, x_pos
);
1119 deer_step(lookdeer2
, y_pos
, x_pos
);
1120 deer_step(lookdeer3
, y_pos
, x_pos
);
1121 deer_step(lookdeer4
, y_pos
, x_pos
);
1124 deer_step(lookdeer0
, y_pos
, x_pos
);
1126 for (; y_pos
< 10; y_pos
++) {
1127 for (looper
= 0; looper
< 2; looper
++) {
1128 deer_step(bigdeer4
, y_pos
, x_pos
);
1129 deer_step(bigdeer3
, y_pos
, x_pos
);
1130 deer_step(bigdeer2
, y_pos
, x_pos
);
1131 deer_step(bigdeer1
, y_pos
, x_pos
);
1132 deer_step(bigdeer2
, y_pos
, x_pos
);
1133 deer_step(bigdeer3
, y_pos
, x_pos
);
1134 deer_step(bigdeer4
, y_pos
, x_pos
);
1136 deer_step(bigdeer0
, y_pos
, x_pos
);
1141 deer_step(lookdeer3
, y_pos
, x_pos
);
1146 done(int sig GCC_UNUSED
)
1148 signal(SIGINT
, done
);
1149 signal(SIGTERM
, done
);
1150 #if !defined DOS && !defined OS2
1151 signal(SIGHUP
, done
);
1152 signal(SIGQUIT
, done
);
1158 ExitProgram(EXIT_SUCCESS
);