|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T r
Length: 1749 (0x6d5) Types: TextFile Names: »ransom.c«
└─⟦b20c6495f⟧ Bits:30007238 EUUGD18: Wien-båndet, efterår 1987 └─⟦this⟧ »EUUGD18/General/Ransom/ransom.c«
#include <stdio.h> #include <ctype.h> char *Font[] = { "R", "I", "B", "R", "I", "B", "R", "I", "B" }; char Size[] = { 30, 30, 30, 24, 24, 24, 18, 18, 18 }; #define NFONTS 9 /* max number of fonts */ #define MAXSIZE 30 /* 30 point font */ int Gsize; /* global point size */ char *Gfont = ""; /* global font */ #define moveup(points) (points && printf ("\\v'%dp'", points)) #define tofont(name) (strcmp (Gfont,name) && (Gfont=name) && prfont (Gfont)) #define prfont(name) printf (strlen (name) == 2 ? "\\f(%s" : "\\f%s", name) #define tosize(points) ((points != Gsize) && printf ("\\s%d", Gsize = points)) typedef int Boole; #define TRUE 1 #define FALSE 0 letter (ioptr) FILE *ioptr; { int c; /* input character */ int curfont = 0; /* current font */ int vertical = 0; /* vertical motion */ Boole inword = FALSE; /* are we in a word */ Boole change = TRUE; /* do we change font? */ while ((c = getc (ioptr)) != EOF) { change = !isalnum (c) || !inword; inword = isalnum (c); if (change) { change = FALSE; moveup (-vertical); /* correct previous vertical motion */ vertical = 0; if (!isspace (c)) { vertical = rand() % 5 - 3; moveup (vertical); curfont = rand() % NFONTS; } else if (c == ' ') curfont = 0; tosize (Size[curfont]); tofont (Font[curfont]); } putchar (c); } } main (argc, argv) char **argv; { int i; long time (); srand ((int) time (0)); printf (".vs %dp\n", (MAXSIZE*3)/2); /* set vertical spacing */ for (i = 1; i < argc; i++) printf ("%s\n", argv[i]); letter (stdin); exit (0); }