15 {A_BOLD, COLOR_YELLOW},
16 {A_BOLD, COLOR_MAGENTA},
18 {A_BOLD, COLOR_WHITE},
20 int ile_b = sizeof bombki / sizeof *bombki;
22 atrybut choinka = {0, COLOR_GREEN};
23 atrybut podstawa = {0, COLOR_YELLOW};
24 atrybut podpis = {A_BOLD, COLOR_RED};
25 atrybut gwiazdka = {A_BOLD, COLOR_YELLOW};
38 void ustaw(atrybut const* attr)
40 static atrybut ostatni = {-1, -1};
41 if (ostatni.attr == attr->attr && ostatni.kolor == attr->kolor) return;
43 if (attr->attr & A_BOLD) {
44 putp(enter_bold_mode);
46 putp(exit_attribute_mode);
48 putp(tparm(set_a_foreground, attr->kolor));
54 setupterm(NULL, 1, NULL);
55 atrybut* kolor = &choinka;
56 for (int i = 0; rysunek[i] != '\0'; i++) {
58 if (c == '[') kolor = &podstawa;
60 if (c >= 'a' && c <= 'z') akt = &podpis;
61 if (c == '.') akt = &bombki[rand() % ile_b];
62 if (c == '*') akt = &gwiazdka;
63 if (c == ']') kolor = &choinka;
67 putp(exit_attribute_mode);