Your program gets a text as an input, at least 8 characters long, and always consisting of even number of characters. (no need to evaluate correctness of input).
Your goal is to display that text as a rectangle. For example, given HelloWorld
as an input, display
Hell
d o
lroW
Rules:
- Text goes around clockwise (starting position as you like)
- It will form a closed rectangle, sides 1 character wide.
- The rectangle will have to encompass the most area inside. (just to rule out the trivial answer of displaying the text in two lines)
- No other characters are printed besides the text itself and the necessary padding spaces and line feeds.
As code-golf, shortest code wins.
Winner is selected not sooner than 10 days after first valid answer.