colonel@gloria.UUCP (Col. G. L. Sicherman) (04/08/85)
/* * rg - GIGI output color filter for rogue. * * adds a little color when you play rogue on GIGI terminals. */ #include <ctype.h> #include <stdio.h> #define puts(x) fputs(x,stdout) #define ESC '\033' #define ARMOR ']' #define FOOD ':' #define GOLD '*' #define POTION '!' #define RING '=' #define SCROLL '?' #define STICK '/' #define TRAP '^' #define WEAPON ')' main() { int c; while (EOF!=(c=getchar())) switch(c) { case ESC: putchar(c); while (EOF!=(c=getchar())) { putchar(c); if (!isdigit(c) && '['!=c && ';'!=c) break; } break; case ARMOR: case WEAPON: puts("\033[34m"); putchar(c); puts("\033[37m"); break; case FOOD: puts("\033[32m"); putchar(c); puts("\033[37m"); break; case GOLD: puts("\033[33m"); putchar(c); puts("\033[37m"); break; case POTION: case RING: case SCROLL: case STICK: puts("\033[35m"); putchar(c); puts("\033[37m"); break; case TRAP: puts("\033[36m"); putchar(c); puts("\033[37m"); break; case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': case 'V': case 'W': case 'X': case 'Y': case 'Z': puts("\033[31m"); putchar(c); puts("\033[37m"); break; default: putchar(c); } exit(0); } -- Col. G. L. Sicherman ...{rocksvax|decvax}!sunybcs!colonel
conor@Glacier.ARPA (Conor Rafferty) (04/10/85)
> /* > * rg - GIGI output color filter for rogue. > * > * adds a little color when you play rogue on GIGI terminals. > */ I did this for a Tektronix a while back, and was forced to learn all sorts of interesting things about signals as a result. Try the motion command ^Y for a good time... (at least on 4.2BSD) conor rafferty/decwrl!glacier!conor/conor@su-glacier.arpa