Pick a quote or phrase that is exactly 5 words long, such as Programming puzzles and code golf!
.
Write a program that, when appended to itself n times, outputs the first n + 1 words of your phrase in order.
For example, if your program code was MYPROG
and your phrase was Programming puzzles and code golf!
, running...
MYPROG
should outputProgramming
MYPROGMYPROG
should outputProgramming puzzles
MYPROGMYPROGMYPROG
should outputProgramming puzzles and
MYPROGMYPROGMYPROGMYPROG
should outputProgramming puzzles and code
MYPROGMYPROGMYPROGMYPROGMYPROG
should outputProgramming puzzles and code golf!
Appending more than 4 times is undefined, your program may do anything.
Rules
- Your phrase must be grammatical meaningful English. Ideally it should be properly capitalized and punctuated.
- Your phrase may be any length but its entropy, as calculated by http://www.shannonentropy.netmark.pl/, may not be less than 3.5.
(Paste in your phrase, hit Calculate and look for the last H(X).) - Your phrase can only contain printable ASCII characters (hex 20 to 7E). Your code can only contain printable ASCII and tabs and newlines.
- Your phrase must contain exactly 5 unique words and 4 spaces. All non-spaces count as parts of words. Spaces are the word boundaries. They may not be leading or trailing; there should be one after all but the last word.
- The output should contain one space between words as well. The output at each appending step may contain trailing spaces but not leading spaces.
- Output to stdout. There is no input.
Scoring
Your score is the length in bytes of your initial un-appended program. (e.g. MYPROG
scores 6)
As this is code-golf, the lowest score wins.