VictorXPDE

C Christmas Tree

Dec 25th, 2020 (edited)
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <time.h>
  4.  
  5. int main()
  6. {
  7.     while(1)
  8.     {
  9.         system("clear");
  10.         srand(time(NULL));
  11.         int colorgen = rand() % 4;
  12.         int colors[] = {9,4,13,226};
  13.  
  14.         printf("\e[38;5;226m     *     \n");
  15.         printf("\e[38;5;34m    ***    \n");
  16.         printf("\e[38;5;34m   ***\e[38;5;%dm*\e[38;5;34m*  \n", colors[colorgen]);
  17.         printf("\e[38;5;34m  *\e[38;5;%d*\e[38;5;34m******  \n", colors[colorgen]);
  18.         printf("\e[38;5;34m ****\e[38;5;%dm*\e[38;5;34m****\n", colors[colorgen]);
  19.         printf("\e[38;5;34m**\e[38;5;%dm*\e[38;5;34m*****\e[38;5;%dm*\e[38;5;34m**\n", colors[colorgen], colors[colorgen]);
  20.         printf("     \e[38;5;94m║     \n");
  21.         printf("     \e[38;5;94m║     \n");
  22.         system("sleep 1");
  23.     }
  24.     return 0;
  25. }
Add Comment
Please, Sign In to add comment