Inspiration
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for WISH YOU A VERY HAPPY NEW YEAR
include
include
include
define BLINK "\033[5m"
define NORMAL "\033[m"
define RED "\033[31m"
define GREEN "\033[32m"
define YELLOW "\033[33m"
define BLUE "\033[34m"
define MAGENTA "\033[35m"
define CYAN "\033[36m"
void print_tree();
const char* colors[] = {RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN};
int main(int argc, char *argv[])
{
print_tree(15, "HAPPY NEW YEAR");
return 0;
}
void print_tree(int n, const char *message)
{
int i;
printf("%s%s%c\n", NORMAL, colors[rand() % 6], n, ' ');
for(i = 1; i < n; ++i)
{
printf("%s%s%*c", i % 2? BLINK: NORMAL, colors[rand() % 6], n - i, ' ');
printf("%c", '*');
printf("%s%c\n", colors[rand() % 6], i*2-1,' ');
}
for(i = 0; i <= n; ++i)
{
printf("%s%s* ", i % 2? BLINK: NORMAL, colors[rand() % 6]);
}
printf("\n%s%s%*s\n", BLINK, colors[rand() % 6], n+2, "||");
printf("%s%s%*s\n", NORMAL, colors[rand() % 6], n+2, "||");
printf("%s%s%*s ", BLINK, colors[rand() % 6], n+2, "||");
for(i = 0; i < strlen(message); ++i)
{
printf("%s%s%c", i % 2? BLINK : NORMAL, colors[rand() % 6], message[i]);
}
printf(NORMAL);
}
Log in or sign up for Devpost to join the conversation.