Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: ASCII Rulers

by jmcnamara (Monsignor)
on Apr 03, 2001 at 17:05 UTC ( #69287=note: print w/replies, xml ) Need Help??


in reply to ASCII Rulers


A second attempt (some whitespace remains):
sub ruler { my $n = ($_[0]+9)/10; (sprintf" "."%10s"x$n."\n",1..$n).'0123456789'x$n."0\n"; }
As a one liner (75 bytes):
perl -e'$n=(9+shift)/10;printf" "."%10s"x$n."\n%s0\n",1..$n,"012345678 +9"x$n'


John.
--

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://69287]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (11)
As of 2017-02-27 17:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (389 votes). Check out past polls.