You are not logged in.

#1 2015-03-05 20:10:30

homk
Member
Registered: 2014-08-30
Posts: 6

howto delay every symbol [SOLVED]

Hi.
I decided to have old-scool terminal, like in sci-fi films: with a delay per every symbol. I think about some ways to do this, but for the first step I wanna ask for advices. Maybe someone did or know this stuff...

Upd: answer

Last edited by homk (2015-03-05 21:29:38)

Offline

#2 2015-03-05 20:16:35

nullified
Member
From: Massachusetts, USA
Registered: 2013-12-09
Posts: 468

Re: howto delay every symbol [SOLVED]

What exactly are you talking about? That video has scenes with terminals from 20 different movies...

Last edited by nullified (2015-03-05 20:16:44)


"We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." - Ada Lovelace

Offline

#3 2015-03-05 20:31:29

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: howto delay every symbol [SOLVED]

Not a Programming issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#4 2015-03-05 20:41:23

homk
Member
Registered: 2014-08-30
Posts: 6

Re: howto delay every symbol [SOLVED]

nullified wrote:

What exactly are you talking about? That video has scenes with terminals from 20 different movies...

I'm talking about exactly this moment in video: 00:27

Offline

#5 2015-03-05 20:51:28

mpan
Member
Registered: 2012-08-01
Posts: 1,227
Website

Re: howto delay every symbol [SOLVED]

Delay per every symbol? Your demands are so unimaginative! I would like to draw that fast with a keyboard, as they do at 0:55; or ability to destroy TV sets by turning a communication satellite into a flameball at 3:31; not mentioning making flameballs in a vacuum!

For your requirements, the solution is easy: Dmitry Grinberg has provided one 3 years ago. You may also try to decrease your PC's clock frequency, given DRAMs will stay stable.

Assuming you prefer not to use the next year of your life on sleeping with an AVR chip, you may just do that:

#include <stdlib.h>
#include <stdbool.h>
#include <stdio.h>
#include <unistd.h>

int main(void) {
    while (true) {
        putchar(getchar());
        fflush(stdout);
        sleep(1);
    }
    return EXIT_SUCCESS;
}

... and pass output of any program through it. If you need bidirectional I/O and/or stderr, or making delay less, you need more code - but the basic idea is the same.

Last edited by mpan (2015-03-05 20:52:17)


Sometimes I seem a bit harsh — don’t get offended too easily!

Offline

#6 2015-03-05 20:52:16

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 7,771
Website

Offline

#7 2015-03-05 20:57:14

homk
Member
Registered: 2014-08-30
Posts: 6

Re: howto delay every symbol [SOLVED]

Yea, exactly, waht I want.
Thanks.

Offline

Board footer

Powered by FluxBB