previndexinfo

code guessing, round #106, stage 1 (writing)

started at . submit by

specification

hello! welcome to episode 2 of "making a text editor, even though we made one before". today's challenge is to justify a text. submissions may be written in any language.

justification is the process of stretching or compressing the spaces between words and between glyphs or letters in order to align both the left and right ends of consecutive lines of text. you may be familiar with it if you've used office programs like LibreOffice, ONLYOFFICE or OpenOffice before.

this challenge implicitly requires you to wrap the text as well, both because IFcoltransG suggested it can be a continuation of the previous text editor task and because you can only justify one line of text for so long. but beware: this is not word wrapping; breaking words up is completely legal and sometimes even required. you can replace space characters with newlines, hyphenate a word or invent creative ways of wrapping your own.

the input may contain multiple paragraphs, which should be wrapped and justified independently. you are free to decide what constitutes a paragraph.

also, the message I got from IFcoltransG mentioned the number 72 several times, so I guess my brand-new code guessing editor v2 is 72 columns wide.

your challenge, given an ASCII string with space characters in it, is to justify (and wrap) the paragraphs in it using the rules above. as any language is allowed, there is no fixed API.

entries

0 entries have been received so far.

submit