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 if (attr->attr & A_BOLD) {
41 putp(enter_bold_mode);
43 putp(exit_attribute_mode);
45 putp(tparm(set_a_foreground, attr->kolor));
51 setupterm(NULL, 1, NULL);
52 atrybut* kolor = &choinka;
53 for (int i = 0; rysunek[i] != '\0'; i++) {
55 if (c == '[') kolor = &podstawa;
57 if (c >= 'a' && c <= 'z') akt = &podpis;
58 if (c == '.') akt = &bombki[rand() % ile_b];
59 if (c == '*') akt = &gwiazdka;
60 if (c == ']') kolor = &choinka;
64 putp(exit_attribute_mode);