Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet thread from alt.ascii-art, started 26 Mar 1994.
 _   _                     _        _             _     _           
| | | |___  ___ _ __   ___| |_     / \   _ __ ___| |__ (_)_   _____ 
| | | / __|/ _ \ '_ \ / _ \ __|   / _ \ | '__/ __| '_ \| \ \ / / _ \
| |_| \__ \  __/ | | |  __/ |_   / ___ \| | | (__| | | | |\ V /  __/
 \___/|___/\___|_| |_|\___|\__| /_/   \_\_|  \___|_| |_|_| \_/ \___|
slow show command with loops (but without bugs)

slow show command with loops (but without bugs)

alt.ascii-art · 1 message · 26 Mar 1994
Here is a working version of my slow show command with loops.
No it works on SUNS and PCS 


/* slow show command by Christoph Hager */
#include <stdio.h>
#include <string.h>
#define DELAY 1  /* test how fast your system is */
void do_sleep(delay)
int delay;
{
long int t;
	for (t=0;t<delay*1000;t++) ;
}
main(argc, argv)   
int argc;
char *argv[];
{
FILE *in;
long pos;  
char ch,*line,linea[90];
int i,t,delay;

	if (argc < 2 || (argc==3 && !atoi(argv[2])) || (argc==4 && !atoi(argv[2]) && !atoi(argv[3])) || argc > 4) {
		printf ("Usage: %s <name of file> <number of loops>\n",argv[0]);
		exit(1);
	}
	if (argc==3) { t=atoi(argv[2]); delay=DELAY; }
	else if (argc==4) { t=atoi(argv[2]); delay=atoi(argv[3]); }
	else { t=1; delay=DELAY; }
	if ((in = fopen(argv[1], "r")) == NULL) {
		fprintf (stderr, "Error: Can't read %s\n", argv[1]);
		exit(1);
	}
	pos=ftell(in);     
	for (i=0;i<t;i++) {
		while (!feof(in)) {
			putc(getc(in),stdout);
			do_sleep(DELAY);
		}
		fseek(in,pos,0);
	}
} 

Related ASCII art in the Gallery

Explore these categories from our collection of 11,000+ artworks:

About this thread. These messages were posted publicly to the newsgroup alt.ascii-art in 1994 and are mirrored here unchanged as part of the Historic Archives – only email addresses are masked. The artwork and text belong to their original authors: if you copy a piece, keep the artist's initials or signature intact and credit them where you can. Are you one of the authors? Contact us to get your posts attributed, connected to your artist profile, or removed.

Report this message

Help us keep the archive clean and accurate. Reports are reviewed by a person – nothing is changed automatically.

Help classify this post