Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options


by OeufMayo (Curate)
on Nov 19, 2001 at 05:20 UTC ( #126195=snippet: print w/replies, xml ) Need Help??

I just saw this boustrophedon text reader project on freshmeat and 10 seconds later, I had this snippet.

For those who are wondering, here's the definition of the word Boustrophedon:

boustrophedon (n.)
  1. an ancient method of writing in which the lines run alternately from right to left and from left to right.

Of course, others have used this ancient method to achieve weird things...

while (<>) {
  print( ( $. % 2 ? $_ : scalar reverse $_ ), "\n" );

Or, for the one-liners/golfers inclined:

perl -npe'chomp;$_=scalar reverse$_ if$.%2;$_.="\n"' file
Replies are listed 'Best First'.
Re: Boustrophedon
by japhy (Canon) on Nov 19, 2001 at 06:25 UTC
    My preferred flip-flop is $|:
    perl -lpe'$_=reverse if--$|'

    Jeff[japhy]Pinyan: Perl, regex, and perl hacker.
    s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;

Re: Boustrophedon
by petral (Curate) on Nov 19, 2001 at 20:32 UTC
    Further pedantry:
    Boustrophedon is greek for "as the ox plows".
    When the alphabet was first borrowed from the right-to-left writing Phoenicians, there was a brief period (c. 8-700 roman bc?) during which this form of writing was actually used by Greek writers before they settled on writing left-to-right.
    The word was borrowed from the classicists when mechanical printers appeared.  These printers could clearly go faster if they started each line where they had ended the previous one (which, of course, is also true of oxen).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: snippet [id://126195]
[ambrus]: Corion: does building airports "somewhat outside of" a city ever work? cities always grow around the airport quickly, because it's practical to be close to it, and after that, people start to complain that the airplanes land so close to their house and sh
[ambrus]: ould keep down the noise

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-02-23 12:06 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (346 votes). Check out past polls.