31
4
Your job is quite simple, write a program that prints Hello, world!
, that when twisted creates a program that prints Twister!
.
How strings are twisted
The twisting algorithm is very simple. Each column is shifted down by its index (col 0 moves down 0, col 1 moves 1, ...). The column shift wraps to the top. It kinda looks like this:
a
ba
cba
----
cba
cb
c
With everything under the line wrapping to the top. Real example:
Original:
\\\\\\\\\\\\
............
............
............
Twisted:
\...\...\...
.\...\...\..
..\...\...\.
...\...\...\
(Further examples and a twisters in your favorite language are here)
Scoring
Your program must be a padded rectangle. This is code-golf so lowest byte count wins!
Rules
- Your first program must print
Hello, world!
. Only one trailing newline is allowed. - Your first and second programs must be in the same language.
- Your second program must print
Twister!
. Only one trailing newline is allowed. - Your program must have at least 2 rows and 2 columns.
3
In Jelly's code page, the character that corresponds to (and, for all purposes, acts like) the linefeed has the code point 127 (ASCII DEL). The character with code point 10 (ASCII linefeed) has the glyph
– Dennis – 2016-02-02T23:26:30.007½
and takes the square root of a number. Which one of the two should be considered the newline for this challenge?Darn, was I the only one that hoped "Twisted Hello World" was using "twisted" in the perverse sense so we'd be outputting something like "Goodbye Cruel World" instead.. – DasBeasto – 2016-02-03T13:49:43.557
@Dennis I suppose the better one to use in this case would be the jelly newline. – J Atkin – 2016-02-03T14:17:47.200
@JAtkin OK, thanks for clarifying. I've updated my answer accordingly. – Dennis – 2016-02-03T17:45:39.007