Settings

The page will reload to apply your changes.
Theme

ASCII Art Font

ASCII Art Menu

Original Usenet message from alt.ascii-art, 1 Nov 2000.
Re: ascii clocks

Re: ascii clocks

Fau...@home.com (Faux_Pseudo) wrote:

> --(Once apon a time, in alt.ascii-art,)--
> 		--(Todd Vargo said it like only they can.)--
> >
> >That's the functionality I was referring to. You don't want to (shouldn't)
> >clear the entire screen (unless the clock will be hovering like a
> >screensaver clock, you didn't say). My qb code only changes the digit that
> >actually changed in the array, then prints only the time again. Oh well, I
> >tried helping.

Perhaps an analogy would help - programming in bash is a little bit
like writing DOS batch files, only bash is far more powerful and has
proper programming language features (control structures and the
like). Still, cursor movement is awkward in bash.

> and there is a way to use the trick you are talking about in bash

tput?

> now the time function works right now but i need to rewrite part of it
> becase the time prints like 
>  2222  
> 22  22 
>    22  
>   22   
>  222   
> 222222 
[vertically-printing one digit after another mostly cut]
>  9999  
> 99  99 
>  9999  
>    99  
>   99   
>  99    
> 
> instead of the corect horazontal out put

Probably the best thing to do if you insist on doing this in bash (and
I have to say that's an amazingly perverse thing to do it in :-)) is
to output the digits to separate temporary files (when you start up
the clock program, preferably) and use `paste' to put them together.
For example, with files `2' and `9' as above:

rus@cartman:2147:/home/rus/tmp>paste 2 9
 2222    9999  
22  22  99  99 
   22    9999  
  22       99  
 222      99   
222222   99    

(You could also make a temp file containing the necessary
cursor-positioning control codes, and list that first in the paste
command-line.)

You might also want to look into using `trap' to clean up any such
temporary files on e.g. ^C. The basic idea would be to do something
like this before writing any of the files:

trap 'rm -f files_to_delete' 0 1 3 15

(Obviously wildcards and variables are ok in the `rm' too.)

ObASCII: one I did a few years back for a ZX Spectrum manual
transcription, which seems appropriately `techie' for this post... :-)

                                  | y-axis
                                  |
                    cosine of a = COS a <-__
                               ___|_|_      --_   a
                           __--   |_v_-+__     -_
                         _-       |   /|  -_     \
                        /         |  / |    \     \
                       /          | /  |<-+  \     |
                      |           |/   |  |   |    |
            ----------+-----------+-------|---+-----------
                      |           |       |   |\     x-axis
                      :\ sine of a = SIN a   /  \
                      : \_        |        _/    \
                      :   --__    |    __--       \
                      :       ----+----             starting
                      :           |                 position
                      <-radius=1 ->
                                  |
                                  |
-Rus.

Original message headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f996b,dd72bd170144bb61
X-Google-Attributes: gidf996b,public
X-Google-ArrivalTime: 2000-11-01 07:37:08 PST
Path: supernews.google.com!sn-xit-02!sn-xit-01!supernews.com!feeder.qis.net!btnet-peer!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news6-win.server.ntlworld.com.POSTED!not-for-mail
Newsgroups: alt.ascii-art
Subject: Re: ascii clocks
References: <slr...@faux.local.net> <8taab1$guv$1...@neptunium.btinternet.com> <slr...@cx743464-a.fed1.sdca.home.com> <8tgvn4$n61r9$1...@ID-25025.news.dfncis.de> <slr...@faux.local.net> <8tk3u3$n4hgo$1...@ID-25025.news.dfncis.de> <slr...@faux.local.net>
From: Russell Marks <russell.marks@spam^H^H^H^Hntlworld.com>
Lines: 87
User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Message-ID: <vMWL5.933$5j5...@news6-win.server.ntlworld.com>
Date: 01 Nov 2000 15:36:54 +0000
NNTP-Posting-Host: 62.252.8.33
X-Complaints-To: abu...@ntlworld.com
X-Trace: news6-win.server.ntlworld.com 973093019 62.252.8.33 (Wed, 01 Nov 2000 15:36:59 GMT)
NNTP-Posting-Date: Wed, 01 Nov 2000 15:36:59 GMT
Organization: ntlworld News Service
Xref: supernews.google.com alt.ascii-art:2523

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 2000 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