Commit | Line | Data |
---|---|---|
2e60f6fd KB |
1 | /* |
2 | * Copyright (c) 1988 Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
102fca3d | 5 | * %sccs.include.redist.c% |
2e60f6fd KB |
6 | */ |
7 | ||
8 | #ifndef lint | |
9 | char copyright[] = | |
10 | "@(#) Copyright (c) 1988 Regents of the University of California.\n\ | |
11 | All rights reserved.\n"; | |
12 | #endif /* not lint */ | |
13 | ||
14 | #ifndef lint | |
102fca3d | 15 | static char sccsid[] = "@(#)ppt.c 5.4 (Berkeley) %G%"; |
2e60f6fd KB |
16 | #endif /* not lint */ |
17 | ||
18 | #include <stdio.h> | |
19 | ||
20 | void putppt(); | |
21 | ||
2e60f6fd KB |
22 | main(argc, argv) |
23 | int argc; | |
24 | char **argv; | |
25 | { | |
26 | register int c; | |
609742fb | 27 | register char *p; |
2e60f6fd KB |
28 | |
29 | (void) puts("___________"); | |
609742fb KB |
30 | if (argc > 1) |
31 | while (p = *++argv) | |
32 | for (; *p; ++p) | |
33 | putppt((int)*p); | |
34 | else while ((c = getchar()) != EOF) | |
2e60f6fd KB |
35 | putppt(c); |
36 | (void) puts("___________"); | |
37 | exit(0); | |
38 | } | |
39 | ||
40 | static void | |
41 | putppt(c) | |
42 | register int c; | |
43 | { | |
44 | register int i; | |
45 | ||
46 | (void) putchar('|'); | |
47 | for (i = 7; i >= 0; i--) { | |
48 | if (i == 2) | |
49 | (void) putchar('.'); /* feed hole */ | |
50 | if ((c&(1<<i)) != 0) | |
51 | (void) putchar('o'); | |
52 | else | |
53 | (void) putchar(' '); | |
54 | } | |
55 | (void) putchar('|'); | |
56 | (void) putchar('\n'); | |
57 | } |