Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #define CLEAR "\033[00;00;00m"
  4.  
  5. static void p_colour(int c1, int c2)
  6. {
  7. char col[10];
  8.  
  9. sprintf(col, "\033[%d;%dm", c1, c2);
  10. printf("\"\\033[%d;%dm\" = %scolour%s\n", c1, c2, col, CLEAR);
  11. fflush(stdout);
  12. }
  13.  
  14. static void test(void)
  15. {
  16. #define COL_BLINK "\033[00;05m"
  17. #define COL_RED "\033[01;29;41m"
  18.  
  19. printf("%s%s_%s\n", COL_BLINK, COL_RED, CLEAR);
  20. fflush(stdout);
  21. }
  22.  
  23. int main(int argc, char *argv[])
  24. {
  25. int i, j;
  26.  
  27. for (i = 0; i < 9; i++) {
  28. for (j = 0; j < 80; j++)
  29. p_colour(i, j);
  30. }
  31. test();
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement