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.25 2009/08/29 18:47:26 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;
134 static bool *my_pairs;
136 static int boxit(void);
137 static int seas(void);
138 static int greet(void);
139 static int fromwho(void);
140 static int tree(void);
141 static int balls(void);
142 static int star(void);
143 static int strng1(void);
144 static int strng2(void);
145 static int strng3(void);
146 static int strng4(void);
147 static int strng5(void);
148 static int reindeer(void);
149 static int blinkit(void);
151 static RETSIGTYPE done(int sig) GCC_NORETURN;
154 set_color(WINDOW *win, chtype color)
159 my_pairs = typeCalloc(bool, COLORS + 1);
161 init_pair(n, color, my_bg);
164 wattroff(win, A_COLOR);
165 wattron(win, COLOR_PAIR(n));
170 unset_color(WINDOW *win)
173 (void) wattrset(win, COLOR_PAIR(0));
180 if (getch() != ERR) {
187 main(int argc GCC_UNUSED, char **argv GCC_UNUSED)
191 setlocale(LC_ALL, "");
202 #if HAVE_USE_DEFAULT_COLORS
203 if (use_default_colors() == OK)
209 if ((treescrn = newwin(16, 27, 3, 53)) == 0 ||
210 (treescrn2 = newwin(16, 27, 3, 53)) == 0 ||
211 (treescrn3 = newwin(16, 27, 3, 53)) == 0 ||
212 (treescrn4 = newwin(16, 27, 3, 53)) == 0 ||
213 (treescrn5 = newwin(16, 27, 3, 53)) == 0 ||
214 (treescrn6 = newwin(16, 27, 3, 53)) == 0 ||
215 (treescrn7 = newwin(16, 27, 3, 53)) == 0 ||
216 (treescrn8 = newwin(16, 27, 3, 53)) == 0 ||
218 (dotdeer0 = newwin(3, 71, 0, 8)) == 0 ||
220 (stardeer0 = newwin(4, 56, 0, 8)) == 0 ||
222 (lildeer0 = newwin(7, 53, 0, 8)) == 0 ||
223 (lildeer1 = newwin(2, 4, 0, 0)) == 0 ||
224 (lildeer2 = newwin(2, 4, 0, 0)) == 0 ||
225 (lildeer3 = newwin(2, 4, 0, 0)) == 0 ||
227 (middeer0 = newwin(15, 42, 0, 8)) == 0 ||
228 (middeer1 = newwin(3, 7, 0, 0)) == 0 ||
229 (middeer2 = newwin(3, 7, 0, 0)) == 0 ||
230 (middeer3 = newwin(3, 7, 0, 0)) == 0 ||
232 (bigdeer0 = newwin(10, 23, 0, 0)) == 0 ||
233 (bigdeer1 = newwin(10, 23, 0, 0)) == 0 ||
234 (bigdeer2 = newwin(10, 23, 0, 0)) == 0 ||
235 (bigdeer3 = newwin(10, 23, 0, 0)) == 0 ||
236 (bigdeer4 = newwin(10, 23, 0, 0)) == 0 ||
238 (lookdeer0 = newwin(10, 25, 0, 0)) == 0 ||
239 (lookdeer1 = newwin(10, 25, 0, 0)) == 0 ||
240 (lookdeer2 = newwin(10, 25, 0, 0)) == 0 ||
241 (lookdeer3 = newwin(10, 25, 0, 0)) == 0 ||
242 (lookdeer4 = newwin(10, 25, 0, 0)) == 0 ||
244 (w_holiday = newwin(1, 26, 3, 27)) == 0 ||
246 (w_del_msg = newwin(1, 19, 23, 60)) == 0) {
248 fprintf(stderr, "Cannot create windows - screen too small\n");
249 ExitProgram(EXIT_FAILURE);
252 mvwaddstr(w_del_msg, 0, 0, "Hit any key to quit");
254 mvwaddstr(w_holiday, 0, 0, "H A P P Y H O L I D A Y S");
256 /* set up the windows for our various reindeer */
259 mvwaddch(lildeer1, 0, 0, (chtype) 'V');
260 mvwaddch(lildeer1, 1, 0, (chtype) '@');
261 mvwaddch(lildeer1, 1, 1, (chtype) '<');
262 mvwaddch(lildeer1, 1, 2, (chtype) '>');
263 mvwaddch(lildeer1, 1, 3, (chtype) '~');
266 mvwaddch(lildeer2, 0, 0, (chtype) 'V');
267 mvwaddch(lildeer2, 1, 0, (chtype) '@');
268 mvwaddch(lildeer2, 1, 1, (chtype) '|');
269 mvwaddch(lildeer2, 1, 2, (chtype) '|');
270 mvwaddch(lildeer2, 1, 3, (chtype) '~');
273 mvwaddch(lildeer3, 0, 0, (chtype) 'V');
274 mvwaddch(lildeer3, 1, 0, (chtype) '@');
275 mvwaddch(lildeer3, 1, 1, (chtype) '>');
276 mvwaddch(lildeer3, 1, 2, (chtype) '<');
277 mvwaddch(lildeer2, 1, 3, (chtype) '~');
280 mvwaddch(middeer1, 0, 2, (chtype) 'y');
281 mvwaddch(middeer1, 0, 3, (chtype) 'y');
282 mvwaddch(middeer1, 1, 2, (chtype) '0');
283 mvwaddch(middeer1, 1, 3, (chtype) '(');
284 mvwaddch(middeer1, 1, 4, (chtype) '=');
285 mvwaddch(middeer1, 1, 5, (chtype) ')');
286 mvwaddch(middeer1, 1, 6, (chtype) '~');
287 mvwaddch(middeer1, 2, 3, (chtype) '\\');
288 mvwaddch(middeer1, 2, 4, (chtype) '/');
291 mvwaddch(middeer2, 0, 2, (chtype) 'y');
292 mvwaddch(middeer2, 0, 3, (chtype) 'y');
293 mvwaddch(middeer2, 1, 2, (chtype) '0');
294 mvwaddch(middeer2, 1, 3, (chtype) '(');
295 mvwaddch(middeer2, 1, 4, (chtype) '=');
296 mvwaddch(middeer2, 1, 5, (chtype) ')');
297 mvwaddch(middeer2, 1, 6, (chtype) '~');
298 mvwaddch(middeer2, 2, 3, (chtype) '|');
299 mvwaddch(middeer2, 2, 5, (chtype) '|');
302 mvwaddch(middeer3, 0, 2, (chtype) 'y');
303 mvwaddch(middeer3, 0, 3, (chtype) 'y');
304 mvwaddch(middeer3, 1, 2, (chtype) '0');
305 mvwaddch(middeer3, 1, 3, (chtype) '(');
306 mvwaddch(middeer3, 1, 4, (chtype) '=');
307 mvwaddch(middeer3, 1, 5, (chtype) ')');
308 mvwaddch(middeer3, 1, 6, (chtype) '~');
309 mvwaddch(middeer3, 2, 2, (chtype) '/');
310 mvwaddch(middeer3, 2, 6, (chtype) '\\');
313 mvwaddch(bigdeer1, 0, 17, (chtype) '\\');
314 mvwaddch(bigdeer1, 0, 18, (chtype) '/');
315 mvwaddch(bigdeer1, 0, 20, (chtype) '\\');
316 mvwaddch(bigdeer1, 0, 21, (chtype) '/');
317 mvwaddch(bigdeer1, 1, 18, (chtype) '\\');
318 mvwaddch(bigdeer1, 1, 20, (chtype) '/');
319 mvwaddch(bigdeer1, 2, 19, (chtype) '|');
320 mvwaddch(bigdeer1, 2, 20, (chtype) '_');
321 mvwaddch(bigdeer1, 3, 18, (chtype) '/');
322 mvwaddch(bigdeer1, 3, 19, (chtype) '^');
323 mvwaddch(bigdeer1, 3, 20, (chtype) '0');
324 mvwaddch(bigdeer1, 3, 21, (chtype) '\\');
325 mvwaddch(bigdeer1, 4, 17, (chtype) '/');
326 mvwaddch(bigdeer1, 4, 18, (chtype) '/');
327 mvwaddch(bigdeer1, 4, 19, (chtype) '\\');
328 mvwaddch(bigdeer1, 4, 22, (chtype) '\\');
329 mvwaddstr(bigdeer1, 5, 7, "^~~~~~~~~// ~~U");
330 mvwaddstr(bigdeer1, 6, 7, "( \\_____( /");
331 mvwaddstr(bigdeer1, 7, 8, "( ) /");
332 mvwaddstr(bigdeer1, 8, 9, "\\\\ /");
333 mvwaddstr(bigdeer1, 9, 11, "\\>/>");
336 mvwaddch(bigdeer2, 0, 17, (chtype) '\\');
337 mvwaddch(bigdeer2, 0, 18, (chtype) '/');
338 mvwaddch(bigdeer2, 0, 20, (chtype) '\\');
339 mvwaddch(bigdeer2, 0, 21, (chtype) '/');
340 mvwaddch(bigdeer2, 1, 18, (chtype) '\\');
341 mvwaddch(bigdeer2, 1, 20, (chtype) '/');
342 mvwaddch(bigdeer2, 2, 19, (chtype) '|');
343 mvwaddch(bigdeer2, 2, 20, (chtype) '_');
344 mvwaddch(bigdeer2, 3, 18, (chtype) '/');
345 mvwaddch(bigdeer2, 3, 19, (chtype) '^');
346 mvwaddch(bigdeer2, 3, 20, (chtype) '0');
347 mvwaddch(bigdeer2, 3, 21, (chtype) '\\');
348 mvwaddch(bigdeer2, 4, 17, (chtype) '/');
349 mvwaddch(bigdeer2, 4, 18, (chtype) '/');
350 mvwaddch(bigdeer2, 4, 19, (chtype) '\\');
351 mvwaddch(bigdeer2, 4, 22, (chtype) '\\');
352 mvwaddstr(bigdeer2, 5, 7, "^~~~~~~~~// ~~U");
353 mvwaddstr(bigdeer2, 6, 7, "(( )____( /");
354 mvwaddstr(bigdeer2, 7, 7, "( / |");
355 mvwaddstr(bigdeer2, 8, 8, "\\/ |");
356 mvwaddstr(bigdeer2, 9, 9, "|> |>");
359 mvwaddch(bigdeer3, 0, 17, (chtype) '\\');
360 mvwaddch(bigdeer3, 0, 18, (chtype) '/');
361 mvwaddch(bigdeer3, 0, 20, (chtype) '\\');
362 mvwaddch(bigdeer3, 0, 21, (chtype) '/');
363 mvwaddch(bigdeer3, 1, 18, (chtype) '\\');
364 mvwaddch(bigdeer3, 1, 20, (chtype) '/');
365 mvwaddch(bigdeer3, 2, 19, (chtype) '|');
366 mvwaddch(bigdeer3, 2, 20, (chtype) '_');
367 mvwaddch(bigdeer3, 3, 18, (chtype) '/');
368 mvwaddch(bigdeer3, 3, 19, (chtype) '^');
369 mvwaddch(bigdeer3, 3, 20, (chtype) '0');
370 mvwaddch(bigdeer3, 3, 21, (chtype) '\\');
371 mvwaddch(bigdeer3, 4, 17, (chtype) '/');
372 mvwaddch(bigdeer3, 4, 18, (chtype) '/');
373 mvwaddch(bigdeer3, 4, 19, (chtype) '\\');
374 mvwaddch(bigdeer3, 4, 22, (chtype) '\\');
375 mvwaddstr(bigdeer3, 5, 7, "^~~~~~~~~// ~~U");
376 mvwaddstr(bigdeer3, 6, 6, "( ()_____( /");
377 mvwaddstr(bigdeer3, 7, 6, "/ / /");
378 mvwaddstr(bigdeer3, 8, 5, "|/ \\");
379 mvwaddstr(bigdeer3, 9, 5, "/> \\>");
382 mvwaddch(bigdeer4, 0, 17, (chtype) '\\');
383 mvwaddch(bigdeer4, 0, 18, (chtype) '/');
384 mvwaddch(bigdeer4, 0, 20, (chtype) '\\');
385 mvwaddch(bigdeer4, 0, 21, (chtype) '/');
386 mvwaddch(bigdeer4, 1, 18, (chtype) '\\');
387 mvwaddch(bigdeer4, 1, 20, (chtype) '/');
388 mvwaddch(bigdeer4, 2, 19, (chtype) '|');
389 mvwaddch(bigdeer4, 2, 20, (chtype) '_');
390 mvwaddch(bigdeer4, 3, 18, (chtype) '/');
391 mvwaddch(bigdeer4, 3, 19, (chtype) '^');
392 mvwaddch(bigdeer4, 3, 20, (chtype) '0');
393 mvwaddch(bigdeer4, 3, 21, (chtype) '\\');
394 mvwaddch(bigdeer4, 4, 17, (chtype) '/');
395 mvwaddch(bigdeer4, 4, 18, (chtype) '/');
396 mvwaddch(bigdeer4, 4, 19, (chtype) '\\');
397 mvwaddch(bigdeer4, 4, 22, (chtype) '\\');
398 mvwaddstr(bigdeer4, 5, 7, "^~~~~~~~~// ~~U");
399 mvwaddstr(bigdeer4, 6, 6, "( )______( /");
400 mvwaddstr(bigdeer4, 7, 5, "(/ \\");
401 mvwaddstr(bigdeer4, 8, 0, "v___= ----^");
404 mvwaddstr(lookdeer1, 0, 16, "\\/ \\/");
405 mvwaddstr(lookdeer1, 1, 17, "\\Y/ \\Y/");
406 mvwaddstr(lookdeer1, 2, 19, "\\=/");
407 mvwaddstr(lookdeer1, 3, 17, "^\\o o/^");
408 mvwaddstr(lookdeer1, 4, 17, "//( )");
409 mvwaddstr(lookdeer1, 5, 7, "^~~~~~~~~// \\O/");
410 mvwaddstr(lookdeer1, 6, 7, "( \\_____( /");
411 mvwaddstr(lookdeer1, 7, 8, "( ) /");
412 mvwaddstr(lookdeer1, 8, 9, "\\\\ /");
413 mvwaddstr(lookdeer1, 9, 11, "\\>/>");
416 mvwaddstr(lookdeer2, 0, 16, "\\/ \\/");
417 mvwaddstr(lookdeer2, 1, 17, "\\Y/ \\Y/");
418 mvwaddstr(lookdeer2, 2, 19, "\\=/");
419 mvwaddstr(lookdeer2, 3, 17, "^\\o o/^");
420 mvwaddstr(lookdeer2, 4, 17, "//( )");
421 mvwaddstr(lookdeer2, 5, 7, "^~~~~~~~~// \\O/");
422 mvwaddstr(lookdeer2, 6, 7, "(( )____( /");
423 mvwaddstr(lookdeer2, 7, 7, "( / |");
424 mvwaddstr(lookdeer2, 8, 8, "\\/ |");
425 mvwaddstr(lookdeer2, 9, 9, "|> |>");
428 mvwaddstr(lookdeer3, 0, 16, "\\/ \\/");
429 mvwaddstr(lookdeer3, 1, 17, "\\Y/ \\Y/");
430 mvwaddstr(lookdeer3, 2, 19, "\\=/");
431 mvwaddstr(lookdeer3, 3, 17, "^\\o o/^");
432 mvwaddstr(lookdeer3, 4, 17, "//( )");
433 mvwaddstr(lookdeer3, 5, 7, "^~~~~~~~~// \\O/");
434 mvwaddstr(lookdeer3, 6, 6, "( ()_____( /");
435 mvwaddstr(lookdeer3, 7, 6, "/ / /");
436 mvwaddstr(lookdeer3, 8, 5, "|/ \\");
437 mvwaddstr(lookdeer3, 9, 5, "/> \\>");
440 mvwaddstr(lookdeer4, 0, 16, "\\/ \\/");
441 mvwaddstr(lookdeer4, 1, 17, "\\Y/ \\Y/");
442 mvwaddstr(lookdeer4, 2, 19, "\\=/");
443 mvwaddstr(lookdeer4, 3, 17, "^\\o o/^");
444 mvwaddstr(lookdeer4, 4, 17, "//( )");
445 mvwaddstr(lookdeer4, 5, 7, "^~~~~~~~~// \\O/");
446 mvwaddstr(lookdeer4, 6, 6, "( )______( /");
447 mvwaddstr(lookdeer4, 7, 5, "(/ \\");
448 mvwaddstr(lookdeer4, 8, 0, "v___= ----^");
450 /***********************************************/
452 nodelay(stdscr, TRUE);
488 /* set up the windows for our blinking trees */
489 /* **************************************** */
492 overlay(treescrn, treescrn3);
495 mvwaddch(treescrn3, 4, 18, ' ');
496 mvwaddch(treescrn3, 7, 6, ' ');
497 mvwaddch(treescrn3, 8, 19, ' ');
498 mvwaddch(treescrn3, 11, 22, ' ');
501 mvwaddch(treescrn3, 0, 12, '*');
504 mvwaddch(treescrn3, 3, 11, ' ');
507 mvwaddch(treescrn3, 5, 13, ' ');
508 mvwaddch(treescrn3, 6, 10, ' ');
511 mvwaddch(treescrn3, 7, 16, ' ');
512 mvwaddch(treescrn3, 7, 14, ' ');
515 mvwaddch(treescrn3, 10, 13, ' ');
516 mvwaddch(treescrn3, 10, 10, ' ');
517 mvwaddch(treescrn3, 11, 8, ' ');
520 mvwaddch(treescrn3, 11, 18, ' ');
521 mvwaddch(treescrn3, 12, 13, ' ');
525 overlay(treescrn, treescrn4);
528 mvwaddch(treescrn4, 3, 9, ' ');
529 mvwaddch(treescrn4, 4, 16, ' ');
530 mvwaddch(treescrn4, 7, 6, ' ');
531 mvwaddch(treescrn4, 8, 19, ' ');
532 mvwaddch(treescrn4, 11, 2, ' ');
533 mvwaddch(treescrn4, 12, 23, ' ');
536 (void) wstandout(treescrn4);
537 mvwaddch(treescrn4, 0, 12, '*');
538 (void) wstandend(treescrn4);
541 mvwaddch(treescrn4, 3, 13, ' ');
546 mvwaddch(treescrn4, 7, 15, ' ');
547 mvwaddch(treescrn4, 8, 11, ' ');
550 mvwaddch(treescrn4, 9, 16, ' ');
551 mvwaddch(treescrn4, 10, 12, ' ');
552 mvwaddch(treescrn4, 11, 8, ' ');
555 mvwaddch(treescrn4, 11, 18, ' ');
556 mvwaddch(treescrn4, 12, 14, ' ');
560 overlay(treescrn, treescrn5);
563 mvwaddch(treescrn5, 3, 15, ' ');
564 mvwaddch(treescrn5, 10, 20, ' ');
565 mvwaddch(treescrn5, 12, 1, ' ');
568 mvwaddch(treescrn5, 0, 12, '*');
571 mvwaddch(treescrn5, 3, 11, ' ');
574 mvwaddch(treescrn5, 5, 12, ' ');
577 mvwaddch(treescrn5, 7, 14, ' ');
578 mvwaddch(treescrn5, 8, 10, ' ');
581 mvwaddch(treescrn5, 9, 15, ' ');
582 mvwaddch(treescrn5, 10, 11, ' ');
583 mvwaddch(treescrn5, 11, 7, ' ');
586 mvwaddch(treescrn5, 11, 17, ' ');
587 mvwaddch(treescrn5, 12, 13, ' ');
591 overlay(treescrn, treescrn6);
594 mvwaddch(treescrn6, 6, 7, ' ');
595 mvwaddch(treescrn6, 7, 18, ' ');
596 mvwaddch(treescrn6, 10, 4, ' ');
597 mvwaddch(treescrn6, 11, 23, ' ');
600 (void) wstandout(treescrn6);
601 mvwaddch(treescrn6, 0, 12, '*');
602 (void) wstandend(treescrn6);
607 mvwaddch(treescrn6, 5, 11, ' ');
610 mvwaddch(treescrn6, 7, 13, ' ');
611 mvwaddch(treescrn6, 8, 9, ' ');
614 mvwaddch(treescrn6, 9, 14, ' ');
615 mvwaddch(treescrn6, 10, 10, ' ');
616 mvwaddch(treescrn6, 11, 6, ' ');
619 mvwaddch(treescrn6, 11, 16, ' ');
620 mvwaddch(treescrn6, 12, 12, ' ');
624 overlay(treescrn, treescrn7);
627 mvwaddch(treescrn7, 3, 15, ' ');
628 mvwaddch(treescrn7, 6, 7, ' ');
629 mvwaddch(treescrn7, 7, 18, ' ');
630 mvwaddch(treescrn7, 10, 4, ' ');
631 mvwaddch(treescrn7, 11, 22, ' ');
634 mvwaddch(treescrn7, 0, 12, '*');
637 mvwaddch(treescrn7, 3, 12, ' ');
640 mvwaddch(treescrn7, 5, 13, ' ');
641 mvwaddch(treescrn7, 6, 9, ' ');
644 mvwaddch(treescrn7, 7, 15, ' ');
645 mvwaddch(treescrn7, 8, 11, ' ');
648 mvwaddch(treescrn7, 9, 16, ' ');
649 mvwaddch(treescrn7, 10, 12, ' ');
650 mvwaddch(treescrn7, 11, 8, ' ');
653 mvwaddch(treescrn7, 11, 18, ' ');
654 mvwaddch(treescrn7, 12, 14, ' ');
664 for (loopy = 0; loopy < 100; loopy++) {
736 mvaddstr(21, 13, FROMWHO);
743 set_color(treescrn, COLOR_GREEN);
744 mvwaddch(treescrn, 1, 11, (chtype) '/');
745 mvwaddch(treescrn, 2, 11, (chtype) '/');
746 mvwaddch(treescrn, 3, 10, (chtype) '/');
747 mvwaddch(treescrn, 4, 9, (chtype) '/');
748 mvwaddch(treescrn, 5, 9, (chtype) '/');
749 mvwaddch(treescrn, 6, 8, (chtype) '/');
750 mvwaddch(treescrn, 7, 7, (chtype) '/');
751 mvwaddch(treescrn, 8, 6, (chtype) '/');
752 mvwaddch(treescrn, 9, 6, (chtype) '/');
753 mvwaddch(treescrn, 10, 5, (chtype) '/');
754 mvwaddch(treescrn, 11, 3, (chtype) '/');
755 mvwaddch(treescrn, 12, 2, (chtype) '/');
757 mvwaddch(treescrn, 1, 13, (chtype) '\\');
758 mvwaddch(treescrn, 2, 13, (chtype) '\\');
759 mvwaddch(treescrn, 3, 14, (chtype) '\\');
760 mvwaddch(treescrn, 4, 15, (chtype) '\\');
761 mvwaddch(treescrn, 5, 15, (chtype) '\\');
762 mvwaddch(treescrn, 6, 16, (chtype) '\\');
763 mvwaddch(treescrn, 7, 17, (chtype) '\\');
764 mvwaddch(treescrn, 8, 18, (chtype) '\\');
765 mvwaddch(treescrn, 9, 18, (chtype) '\\');
766 mvwaddch(treescrn, 10, 19, (chtype) '\\');
767 mvwaddch(treescrn, 11, 21, (chtype) '\\');
768 mvwaddch(treescrn, 12, 22, (chtype) '\\');
770 mvwaddch(treescrn, 4, 10, (chtype) '_');
771 mvwaddch(treescrn, 4, 14, (chtype) '_');
772 mvwaddch(treescrn, 8, 7, (chtype) '_');
773 mvwaddch(treescrn, 8, 17, (chtype) '_');
775 mvwaddstr(treescrn, 13, 0, "//////////// \\\\\\\\\\\\\\\\\\\\\\\\");
777 mvwaddstr(treescrn, 14, 11, "| |");
778 mvwaddstr(treescrn, 15, 11, "|_|");
780 unset_color(treescrn);
790 overlay(treescrn, treescrn2);
792 set_color(treescrn2, COLOR_BLUE);
793 mvwaddch(treescrn2, 3, 9, (chtype) '@');
794 mvwaddch(treescrn2, 3, 15, (chtype) '@');
795 mvwaddch(treescrn2, 4, 8, (chtype) '@');
796 mvwaddch(treescrn2, 4, 16, (chtype) '@');
797 mvwaddch(treescrn2, 5, 7, (chtype) '@');
798 mvwaddch(treescrn2, 5, 17, (chtype) '@');
799 mvwaddch(treescrn2, 7, 6, (chtype) '@');
800 mvwaddch(treescrn2, 7, 18, (chtype) '@');
801 mvwaddch(treescrn2, 8, 5, (chtype) '@');
802 mvwaddch(treescrn2, 8, 19, (chtype) '@');
803 mvwaddch(treescrn2, 10, 4, (chtype) '@');
804 mvwaddch(treescrn2, 10, 20, (chtype) '@');
805 mvwaddch(treescrn2, 11, 2, (chtype) '@');
806 mvwaddch(treescrn2, 11, 22, (chtype) '@');
807 mvwaddch(treescrn2, 12, 1, (chtype) '@');
808 mvwaddch(treescrn2, 12, 23, (chtype) '@');
810 unset_color(treescrn2);
819 (void) wattrset(treescrn2, A_BOLD | A_BLINK);
820 set_color(treescrn2, COLOR_YELLOW);
822 mvwaddch(treescrn2, 0, 12, (chtype) '*');
823 (void) wstandend(treescrn2);
825 unset_color(treescrn2);
834 (void) wattrset(treescrn2, A_BOLD | A_BLINK);
835 set_color(treescrn2, COLOR_WHITE);
837 mvwaddch(treescrn2, 3, 13, (chtype) '\'');
838 mvwaddch(treescrn2, 3, 12, (chtype) ':');
839 mvwaddch(treescrn2, 3, 11, (chtype) '.');
841 wattroff(treescrn2, A_BOLD | A_BLINK);
842 unset_color(treescrn2);
852 (void) wattrset(treescrn2, A_BOLD | A_BLINK);
853 set_color(treescrn2, COLOR_WHITE);
855 mvwaddch(treescrn2, 5, 14, (chtype) '\'');
856 mvwaddch(treescrn2, 5, 13, (chtype) ':');
857 mvwaddch(treescrn2, 5, 12, (chtype) '.');
858 mvwaddch(treescrn2, 5, 11, (chtype) ',');
859 mvwaddch(treescrn2, 6, 10, (chtype) '\'');
860 mvwaddch(treescrn2, 6, 9, (chtype) ':');
862 wattroff(treescrn2, A_BOLD | A_BLINK);
863 unset_color(treescrn2);
873 (void) wattrset(treescrn2, A_BOLD | A_BLINK);
874 set_color(treescrn2, COLOR_WHITE);
876 mvwaddch(treescrn2, 7, 16, (chtype) '\'');
877 mvwaddch(treescrn2, 7, 15, (chtype) ':');
878 mvwaddch(treescrn2, 7, 14, (chtype) '.');
879 mvwaddch(treescrn2, 7, 13, (chtype) ',');
880 mvwaddch(treescrn2, 8, 12, (chtype) '\'');
881 mvwaddch(treescrn2, 8, 11, (chtype) ':');
882 mvwaddch(treescrn2, 8, 10, (chtype) '.');
883 mvwaddch(treescrn2, 8, 9, (chtype) ',');
885 wattroff(treescrn2, A_BOLD | A_BLINK);
886 unset_color(treescrn2);
896 (void) wattrset(treescrn2, A_BOLD | A_BLINK);
897 set_color(treescrn2, COLOR_WHITE);
899 mvwaddch(treescrn2, 9, 17, (chtype) '\'');
900 mvwaddch(treescrn2, 9, 16, (chtype) ':');
901 mvwaddch(treescrn2, 9, 15, (chtype) '.');
902 mvwaddch(treescrn2, 9, 14, (chtype) ',');
903 mvwaddch(treescrn2, 10, 13, (chtype) '\'');
904 mvwaddch(treescrn2, 10, 12, (chtype) ':');
905 mvwaddch(treescrn2, 10, 11, (chtype) '.');
906 mvwaddch(treescrn2, 10, 10, (chtype) ',');
907 mvwaddch(treescrn2, 11, 9, (chtype) '\'');
908 mvwaddch(treescrn2, 11, 8, (chtype) ':');
909 mvwaddch(treescrn2, 11, 7, (chtype) '.');
910 mvwaddch(treescrn2, 11, 6, (chtype) ',');
911 mvwaddch(treescrn2, 12, 5, (chtype) '\'');
913 wattroff(treescrn2, A_BOLD | A_BLINK);
914 unset_color(treescrn2);
924 (void) wattrset(treescrn2, A_BOLD | A_BLINK);
925 set_color(treescrn2, COLOR_WHITE);
927 mvwaddch(treescrn2, 11, 19, (chtype) '\'');
928 mvwaddch(treescrn2, 11, 18, (chtype) ':');
929 mvwaddch(treescrn2, 11, 17, (chtype) '.');
930 mvwaddch(treescrn2, 11, 16, (chtype) ',');
931 mvwaddch(treescrn2, 12, 15, (chtype) '\'');
932 mvwaddch(treescrn2, 12, 14, (chtype) ':');
933 mvwaddch(treescrn2, 12, 13, (chtype) '.');
934 mvwaddch(treescrn2, 12, 12, (chtype) ',');
936 wattroff(treescrn2, A_BOLD | A_BLINK);
937 unset_color(treescrn2);
939 /* save a fully lit tree */
940 overlay(treescrn2, treescrn);
960 overlay(treescrn3, treescrn8);
965 overlay(treescrn4, treescrn8);
970 overlay(treescrn5, treescrn8);
975 overlay(treescrn6, treescrn8);
980 overlay(treescrn7, treescrn8);
987 /*ALL ON************************************************** */
989 overlay(treescrn, treescrn8);
998 deer_step(WINDOW *win, int y, int x)
1002 wrefresh(w_del_msg);
1012 for (x_pos = 70; x_pos > 62; x_pos--) {
1016 for (looper = 0; looper < 4; looper++) {
1017 mvwaddch(dotdeer0, y_pos, x_pos, (chtype) '.');
1019 wrefresh(w_del_msg);
1022 wrefresh(w_del_msg);
1029 for (; x_pos > 50; x_pos--) {
1030 for (looper = 0; looper < 4; looper++) {
1035 mvwaddch(stardeer0, y_pos, x_pos, (chtype) '*');
1036 wrefresh(stardeer0);
1037 wrefresh(w_del_msg);
1039 wrefresh(stardeer0);
1040 wrefresh(w_del_msg);
1042 mvwaddch(dotdeer0, y_pos, x_pos, (chtype) '*');
1044 wrefresh(w_del_msg);
1047 wrefresh(w_del_msg);
1054 for (y_pos = 2; y_pos < 5; y_pos++) {
1058 wrefresh(w_del_msg);
1060 for (looper = 0; looper < 4; looper++) {
1061 deer_step(lildeer3, y_pos, x_pos);
1062 deer_step(lildeer2, y_pos, x_pos);
1063 deer_step(lildeer1, y_pos, x_pos);
1064 deer_step(lildeer2, y_pos, x_pos);
1065 deer_step(lildeer3, y_pos, x_pos);
1069 wrefresh(w_del_msg);
1077 for (y_pos = 5; y_pos < 10; y_pos++) {
1081 wrefresh(w_del_msg);
1083 for (looper = 0; looper < 2; looper++) {
1084 deer_step(middeer3, y_pos, x_pos);
1085 deer_step(middeer2, y_pos, x_pos);
1086 deer_step(middeer1, y_pos, x_pos);
1087 deer_step(middeer2, y_pos, x_pos);
1088 deer_step(middeer3, y_pos, x_pos);
1092 wrefresh(w_del_msg);
1102 for (x_pos = 8; x_pos < 16; x_pos++) {
1103 deer_step(bigdeer4, y_pos, x_pos);
1104 deer_step(bigdeer3, y_pos, x_pos);
1105 deer_step(bigdeer2, y_pos, x_pos);
1106 deer_step(bigdeer1, y_pos, x_pos);
1107 deer_step(bigdeer2, y_pos, x_pos);
1108 deer_step(bigdeer3, y_pos, x_pos);
1109 deer_step(bigdeer4, y_pos, x_pos);
1110 deer_step(bigdeer0, y_pos, x_pos);
1115 for (looper = 0; looper < 6; looper++) {
1116 deer_step(lookdeer4, y_pos, x_pos);
1117 deer_step(lookdeer3, y_pos, x_pos);
1118 deer_step(lookdeer2, y_pos, x_pos);
1119 deer_step(lookdeer1, y_pos, x_pos);
1120 deer_step(lookdeer2, y_pos, x_pos);
1121 deer_step(lookdeer3, y_pos, x_pos);
1122 deer_step(lookdeer4, y_pos, x_pos);
1125 deer_step(lookdeer0, y_pos, x_pos);
1127 for (; y_pos < 10; y_pos++) {
1128 for (looper = 0; looper < 2; looper++) {
1129 deer_step(bigdeer4, y_pos, x_pos);
1130 deer_step(bigdeer3, y_pos, x_pos);
1131 deer_step(bigdeer2, y_pos, x_pos);
1132 deer_step(bigdeer1, y_pos, x_pos);
1133 deer_step(bigdeer2, y_pos, x_pos);
1134 deer_step(bigdeer3, y_pos, x_pos);
1135 deer_step(bigdeer4, y_pos, x_pos);
1137 deer_step(bigdeer0, y_pos, x_pos);
1142 deer_step(lookdeer3, y_pos, x_pos);
1147 done(int sig GCC_UNUSED)
1161 ExitProgram(EXIT_SUCCESS);