Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet message from alt.ascii-art, 10 Sep 2008.
Re: pause
In alt.ascii-art, jer0en <jer...@freemail.nl> wrote:
> trouble with ascii and the initial set of control codes is there isn't a
> pause character, not even in ansi.

You are doing animations? The old trick is just pad with some sort of
no-op to get the delay needed. Spaces and carriage return (without
linefeed), lots of nulls, things like that. Those worked fine on the
slow (2400 or less) connection speeds of old, but you need a lot of
padding for a modern window. My xterm ssh'ed to a remote host claims
to be 38400 baud, but I bet it's faster than that. 

My crude -- it works for some animations, but not all --  solution:
a perl script I call slowcat, that pauses during printing. Source
included below.

Elijah
------
#!/usr/bin/perl -wn
# slowcat: A slow version of 'cat' for playing ascii-art movies on
# fast terminals.
#
# B. Elijah Griffin / Eli the Bearded	7 Jun 2001

use strict;
use vars qw( $part @parts $delay $default);

BEGIN {
  my $usage;

  $default = 0.02;

USAGE:
  if ($usage) {
    print STDERR <<"UsageEnd";
$0: usage
    slowcat [ -d delay ] [file ...]

Delay is fractional seconds.  Default delay is $default seconds.
UsageEnd
    exit 2;
  }

  if (defined($ARGV[0])) {
    if ($ARGV[0] eq '-h' or $ARGV[0] eq '--help') {
      $usage = 1;
      goto USAGE;
    } elsif ($ARGV[0] eq '-d' or $ARGV[0] eq '--delay') {
      shift;
      $delay = shift;
      if (!defined($delay) or $delay !~ /^(?:\d*\.)?\d+$/) {
        warn "$0: Bad delay\n";
        $usage = 1;
        goto USAGE;
      }
    }
  }

  $delay = $default unless $delay;
  $| ++;
# system("tput clear");
}

@parts = split(/(?=\c[)/);
for $part (@parts) {
  if (length($part) > 80) {
    while(length($part)) {
      select(undef,undef,undef, $delay);
      print substr($part,0,80,'');
    }
  } else {
    select(undef,undef,undef, $delay);
    print $part;
  }
}

__END__

Original message headers
X-Google-Thread: f996b,1b4bd24f205e7eb3
X-Google-Attributes: gidf996b,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!news-xxxfer.readnews.com!panix!qz!not-for-mail
From: Eli the Bearded <*@eli.users.panix.com>
Newsgroups: alt.ascii-art
Subject: Re: pause
Date: Wed, 10 Sep 2008 22:14:20 +0000 (UTC)
Organization: Some absurd concept
Lines: 79
Message-ID: <eli$080...@qz.little-neck.ny.us>
References: <5e22b$48c5a33a$3ec21f53$110...@news.chello.nl>
NNTP-Posting-Host: panix2.panix.com
X-Trace: reader1.panix.com 1221084860 7846 166.84.1.2 (10 Sep 2008 22:14:20 GMT)
X-Complaints-To: abu...@panix.com
NNTP-Posting-Date: Wed, 10 Sep 2008 22:14:20 +0000 (UTC)
X-Liz: It's actually happened, the entire Internet is a massive game of Redcode
X-Motto: "Erosion of rights never seems to reverse itself." -- kenny@panix
X-US-Congress: Moronic Fucks.
X-Attribution: EtB
Encrypted: double rot-13
User-Agent: Vectrex rn 2.1 (beta)
X-Comments: "(Welcome to the desert of the real.)" -- eck@panix
	    "... terrorism is open-source war ..." -- srini@unamerican
Xref: g2news2.google.com alt.ascii-art:1322
About this message. This message was posted publicly to the newsgroup alt.ascii-art in 2008 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