Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- /* http://en.wikipedia.org/wiki/ANSI_escape_code */
- #define G 100
- #define L 10
- #define I 10
- #define T 100
- #define C 50
- #define H 20
- int main(int argc,char *argv[]) {
- short in;
- srandom(getpid() + time(0));
- while((in=fgetc(stdin)) != -1) {
- if(!(random() % G)) {
- printf("\x1b[3%1dm",random() % L);
- printf("\x1b[4%1dm",random() % I);
- }
- if(!(random() % T)) {
- printf(" ");
- }
- if(!(random() % C)) {
- printf("\x1b[1m");
- }
- if(in != '\n') {
- if(!(random() % H)) in^=(1<<(random()%8));
- printf("%c",in);
- }
- else printf("\n");
- }
- printf("\x1b[00m");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement