Skip to content

Instantly share code, notes, and snippets.

@Witiko
Created May 27, 2013 01:27
Show Gist options
  • Save Witiko/5654708 to your computer and use it in GitHub Desktop.
Save Witiko/5654708 to your computer and use it in GitHub Desktop.
# include <stdio.h>
# include <stdlib.h>
# include <time.h>
void color() {
printf("\033[38;5;%dm", 17 + 6 * (rand() % 35) + rand() % 4);
}
int main() {
int input; srand(time(NULL)); color();
while((input = getchar()) != EOF) {
if(input == '\n') color();
putchar(input); fflush(stdout);
} puts("\033[m"); return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment