[comp.sources.games] v05i060: flicker - ANSI terminal teaser

games@tekred.TEK.COM (09/01/88)

Submitted by: "Gene H. Olson" <gene@zeno.mn.org>
Comp.sources.games: Volume 5, Issue 60
Archive-name: flicker

	[Cute use of ANSI escape sequences. It works as advertised.  -br]

#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of shell archive."
# Contents:  README flicker.c
# Wrapped by billr@saab on Wed Aug 31 10:45:09 1988
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'README' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'README'\"
else
echo shar: Extracting \"'README'\" \(248 characters\)
sed "s/^X//" >'README' <<'END_OF_FILE'
XNo explanations given or required.  I promise this program will not
Xdamage your terminal, although it may look for a moment as if it is
Xdoing so.
X
XEnjoy, and be sensible.  (Use Interrupt to exit the program.)
X
XGene H. Olson
Xamdahl!bungia!zeno!gene
END_OF_FILE
if test 248 -ne `wc -c <'README'`; then
    echo shar: \"'README'\" unpacked with wrong size!
fi
# end of 'README'
fi
if test -f 'flicker.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'flicker.c'\"
else
echo shar: Extracting \"'flicker.c'\" \(360 characters\)
sed "s/^X//" >'flicker.c' <<'END_OF_FILE'
X#define N 1000
X
Xextern char *malloc() ;
Xextern char *strcpy() ;
X
Xmain()
X{
X	register int i ;
X	register int s ;
X	register char *p ;
X	register char *buf ;
X	register char *str ;
X
X	str = "\033[H\033[4L\033[4M" ;
X	s = strlen(str) ;
X	buf = p = malloc(N*s+1) ;
X
X	for (i = 0 ; i < N ; i++) {
X		strcpy(p, str) ;
X		p += s ;
X		}
X
X	for (;;) {
X		write(1, buf, N*s) ;
X		}
X	}
END_OF_FILE
if test 360 -ne `wc -c <'flicker.c'`; then
    echo shar: \"'flicker.c'\" unpacked with wrong size!
fi
# end of 'flicker.c'
fi
echo shar: End of shell archive.
exit 0