35
4
A boustrophedon is a text where every other line of writing is flipped or reversed, with reversed letters.
In this challenge, we will just reverse every other line, but leave the actual characters used intact. You may chose which lines to reverse, as long as it is every other one.
You may take the text in any suitable format as long as you support zero or more lines of printable ASCII, each with zero or more characters.
Examples:
["Here are some lines","of text for you","to make a","boustrophedon"]:
["Here are some lines","uoy rof txet fo","to make a","nodehportsuob"] or ["senil emos era ereH","of text for you","a ekam ot","boustrophedon"]
["My boustrophedon"]:
["My boustrophedon"] or ["nodehportsuob yM"]
[]:
[]
["Some text","","More text","","","Last bit of text"]:
["Some text","","More text","","","txet fo tib tsaL"] or ["txet emoS","","txet eroM","","","Last bit of text"]
Can't understand if return and input need to be text separated lines or it can be a file or a list of lines. – sergiol – 2017-12-08T12:30:23.437
@sergiol Default PPCG I/O rules apply.
– Adám – 2017-12-08T12:35:14.310Can my code behave inconsistently, i.e. sometimes start reversing from the first line and sometimes from the second? – Erik the Outgolfer – 2017-12-08T13:02:07.703
2@EriktheOutgolfer Yes, I asked about this earlier and the wording of "You may chose which lines to reverse, as long as it is every other one." was actually changed to what it is now to make it general enough for that behaviour. – Martin Ender – 2017-12-08T13:12:25.710
More answer than upvotes... – user202729 – 2017-12-08T13:36:01.003
Perhaps a good testcase:
["Some text","","More text","","","Last bit of text"]
– Sanchises – 2017-12-08T16:50:40.2901@totallyhuman Yes, as per OP. – Adám – 2017-12-09T20:07:10.220
How does the last example work?
"Last bit of text"
is never reversed and"More text"
always is. – CJ Dennis – 2017-12-11T00:41:47.460@CJDennis Fixed. – Adám – 2017-12-11T08:00:49.027
Related – user41805 – 2018-05-13T19:53:14.573