Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet message from alt.ascii-art, 26 Mar 1994.
slow show command with loops (but without bugs)

slow show command with loops (but without bugs)

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);
	}
} 

Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f996b,5a4f2f9997bd339e,start
X-Google-Attributes: gidf996b,public
X-Google-ArrivalTime: 1994-03-26 04:56:27 PST
Path: gmd.de!xlink.net!howland.reston.ans.net!pipex!uknet!EU.net!Germany.EU.net!gsf.de!not-for-mail
From: hag...@cony.gsf.de (Christoph Hager)
Newsgroups: alt.ascii-art
Subject: slow show command with loops (but without bugs)
Date: 26 Mar 1994 13:56:27 +0100
Organization: GSF Forschungszentrum fuer Umwelt und Gesundheit mbH
Lines: 44
Message-ID: <2n1bdr$89...@cony.gsf.de>
NNTP-Posting-Host: cony.gsf.de

Related ASCII art in the Gallery

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

About this message. This message was posted publicly to the newsgroup alt.ascii-art in 1994 and is 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 the author? 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