Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

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

slow show command with loops

alt.ascii-art · 1 message · 22 Mar 1994
For those animations like globe.vt.
The first argument is the name of the animation.
The second (optional) is the number of times it will be played.
The third (optional) is the delay.

Christoph
---
p70...@sunmail.lrz-muenchen.de


----------------  cut here  ---------------------
/* slow cat by Christoph Hager */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define DELAY 1  /* test how fast your system is */

void sleep(int);
Main(argc, argv)   
int argc;
char *argv[];
{
FILE *in;
fpos_t 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);
	}
	fgetpos(in,&pos);
	for (i=0;i<t;i++) {
		while (!feof(in)) {
			putc(getc(in),stdout);
			sleep(DELAY);
		}
		fsetpos(in,&pos);
	}
} 
void sleep(delay)  
int delay;
{
long int t;
	for (t=0;t<delay*1000;t++) ;
}

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