Finally found it. It is written by ryoh and called eyecandy:
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#undef LINE_MAX
#define LINE_MAX 256
char *randstring(int length);
void mutate(char *src, const char *dest);
int main(int argc, char *argv[]) {
if(argc != 2) {
fprintf(stderr, "Specify a file\n");
exit(1);
}
FILE *fin;
if((fin = fopen(argv[1], "r")) == NULL) {
perror("in fopen");
exit(1);
}
char *buffer;
buffer = (char *) malloc(LINE_MAX);
bzero(buffer, LINE_MAX);
char temp[LINE_MAX];
bzero(temp, LINE_MAX);
unsigned int size = LINE_MAX-1;
while(getline(&buffer, &size, fin) != EOF) {
int count;
for(count = 0; buffer[count] != '\0'; count++) {
if(buffer[count] == '\n')
continue;
else
temp[count] = buffer[count];
}
bzero(buffer, strlen(buffer));
strncpy(buffer, temp, strlen(temp));
mutate(randstring(strlen(buffer)), buffer);
bzero(temp, strlen(temp));
puts("");
}
free(buffer);
fclose(fin);
return 0;
}
char *randstring(int length) {
if(length >= LINE_MAX)
length = LINE_MAX-1;
static char keys[] = {
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"1234567890"
};
static char buffer[LINE_MAX];
bzero(buffer, LINE_MAX);
srand(time(0));
for(;length != 0; length--)
strncat(buffer, &keys[rand()%strlen(keys)], 1);
return buffer;
}
void mutate(char *src, const char *dest) {
struct timespec slp = {0, 62500000};
int go = 1;
while(go) {
if (strcmp(src, dest) == 0)
go=0;
printf("\r%s",src);
int count;
for(count = 0; src[count] != '\0'; count++) {
if (src[count] == dest[count])
continue;
else if (src[count] < dest[count])
src[count]++;
else
src[count]--;
}
fflush(stdout);
nanosleep(&slp, NULL);
}
}
Try it out. The effect looks a bit better, since not only the last character is switching.