date and time created 88/02/08 14:02:00 by bostic
[unix-history] / usr / src / games / ppt / ppt.c
CommitLineData
2e60f6fd
KB
1/*
2 * Copyright (c) 1988 Regents of the University of California.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms are permitted
6 * provided that this notice is preserved and that due credit is given
7 * to the University of California at Berkeley. The name of the University
8 * may not be used to endorse or promote products derived from this
9 * software without specific prior written permission. This software
10 * is provided ``as is'' without express or implied warranty.
11 */
12
13#ifndef lint
14char copyright[] =
15"@(#) Copyright (c) 1988 Regents of the University of California.\n\
16 All rights reserved.\n";
17#endif /* not lint */
18
19#ifndef lint
20static char sccsid[] = "@(#)ppt.c 5.1 (Berkeley) %G%";
21#endif /* not lint */
22
23#include <stdio.h>
24
25void putppt();
26
27/*ARGSUSED*/
28main(argc, argv)
29 int argc;
30 char **argv;
31{
32 register int c;
33
34 (void) puts("___________");
35 while ((c = getchar()) != EOF)
36 putppt(c);
37 (void) puts("___________");
38 exit(0);
39}
40
41static void
42putppt(c)
43 register int c;
44{
45 register int i;
46
47 (void) putchar('|');
48 for (i = 7; i >= 0; i--) {
49 if (i == 2)
50 (void) putchar('.'); /* feed hole */
51 if ((c&(1<<i)) != 0)
52 (void) putchar('o');
53 else
54 (void) putchar(' ');
55 }
56 (void) putchar('|');
57 (void) putchar('\n');
58}