Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet message from alt.ascii-art, 10 Nov 1993.
Re: How to slow down animation

Re: How to slow down animation

blb...@cantor.math.uwaterloo.ca (Bernard Lam) writes: 

>
>	I'm just wondering how to slow down the animated files.  When I view
>the files using the 'cat' command in UNIX, it goes so fast that I can't s...
>
Following is a simple C-program I used to slow the display down, it is pretty
BSDism and I hope it will work for you. Let's say you compile this program
into an executable called slowcat, then you can try

	slowcat 1000 < your_anim_file

This will try to display at most 1000 characters per second. Notice this
program will try to perform some buffering to minimize its load. If you
are desperate for single char I/O, you may also try the dd command,

	dd if=your_anim_file bs=1

----slowcat.c-------------------------------------------------------
#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
void
nap(unsigned int ms){
    if(ms > 0){
	struct timeval tm;
	tm.tv_sec  = ms/1000000;
	tm.tv_usec = ms%1000000;
	select(0,0,0,0,&tm);
    }
}
int
main(int argc,char *argv[]){
    char buf[1024], *p, *q, *r;
    int  len, delay = 500;
    argc--; argv++;
    if(argc-- > 0)
	if((len = atoi(*argv++))>0)
	    delay = 1000000/len;
    for(len=1024; (len==1024) && ((len = fread(buf,1,1024,stdin)) > 0);)
	for(p = buf, q = p + len, r = p; p != q; p = r){
	    for(r++;r != q;r++)
		if((*r == '\n') || (*r == '\r') || ((r - p) > 128))
		    break;
	    fwrite(p,r-p,1,stderr);
	    nap(delay * (r-p));
	}
}
-------------------------------------achille (eil...@drizzle.stanford.edu)
ObAscii:    
    
    
    "
     "o         ooo$oo
       "$$    o$$$$$$$$o
          "$$$$$$$"   $$o
           o$$$$$$o$oo$$$
           $$$$"  ""$$$$$ooooo
          o$$$      o$$$""$"$$$$o$ooo
         o$$$"    o$$$$"       " "$$$$$$$$o$
         o$$$   oo$$$$"         oooo$$$$$$$$$o
         $$$   o$$$$$   oooo$$$$$$$$$$$$""""
          $$"o$$$$$$$$$$$$$$$$$$""""
          $$$$$$$$$$$$$$$"""
           $$$$$$""""
           $$"
            $$    oo
             "o $$$$$$$$oo
              $$$$$"""""""$ o
              $$$""         $o
              $$$           "$o
              "$"          o$$$
               $$         "$$$$
               "$"          """
                  $ o
                   " $$oooo oooo$ooo$$$$o$$$$$$$$ooo
                 ooo$$$$$$$$$$$$$$$$$$$$"$$$""$$""$"o
                  $$$$$$$$$$$$"$"$$$$ooo            $$o
                    "  "" """$$ooo """"$$$$$o$$oo$$$$$$o
                                ""o      """""$$"$$$$""
                                 "$$
                                  $$
                       ooo$ooo$$$$$$$
                     $$$$$$$$$$$$$"""
                     "$$"" "
                      $$
                        $oo o
                          "$$$ooo
                        o$$$$$$$$$$$$$oo     $$$o
                        $$$$""""$""$"$$$      $$$o
                        o$$                     ""
                          "o
                            $ooo                o   o   o
                              "$$$ooooooo$ooo$$$$$$$$$$$$$$oo
                             oooo$$$$$$$$$$$$$$$$"""$""""""""$o
                            $$$$$$$$$"""""$"$$$oooo         oo$oo
                            $$$"" "         " """$$$$$$$$$$$$$$$$
                            "$"                     " """$""$"""
                              $
                               "$$$ooo o  ooo oooo$o$o$$o$o$$ooo
                                  "$$$$$$$$$$$$$$$$$$$"$$$"$$$"$$ o
                               o$$$$$$$$$$$"$$$$$$"o             $oo
                               $$$$""""        """$"$$$$$o$ooo$$$$$$
                                $$                   """""$$$$$$$$""
                                ""o
                                   $$oo ooo o
                                    o$$$$$$$$$ooo
                                   o$$$$$""" """oo
                                   $$$$"        o$$
                                  "$$$ ""$oo ooo$$$
                                   "$o    ""$$$$$$$"
                                    $$        " "
                                     o"
                                       "$o$o
                                          "$$$oo
                                               "

Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f996b,ac750d31c700498f
X-Google-Attributes: gidf996b,public
X-Google-ArrivalTime: 1993-11-10 04:31:01 PST
Newsgroups: alt.ascii-art
Path: gmd.de!xlink.net!howland.reston.ans.net!agate!headwall.Stanford.EDU!nntp.Stanford.EDU!eil...@drizzle.Stanford.EDU
From: eil...@drizzle.StanFord.EDU ( Achille Hui, the Day Dreamer )
Subject: Re: How to slow down animation
Message-ID: <eil...@drizzle.Stanford.EDU>
Sender: new...@leland.Stanford.EDU (Mr News)
X-Transfer-Agent: nntp.stanford.edu (NNTP)
Organization: Dept. of Physics, Stanford University.
Date: 10 Nov 93 12:03:31 GMT
Lines: 117
About this message. This message was posted publicly to the newsgroup alt.ascii-art in 1993 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