Create a program, that outputs a hello world string ("Hello world", "Hello, World" etc.), and source code. Output is written to stdout or equivalent. Hello world string is embedded in the source code.
For example, the output for might be
(some source code here)hello world(some source code here)
When the output is compiled or interpreted again, it should create a similar output, but the hello world string must have a different punctuation or capitalization. For example, the previous example could create the following output
(some source code here)hello, wORld(some source code here)
Each "(some source code here)" in these examples can change after each execution, or it can be the same.
Your output must contain a valid hello world string exactly once. It may contain any amount of invalid hello world strings. Source code may contain any amount of comments, and the hello world string may be embedded in comments. The first program can have either zero or one valid hello world strings, but no more.
Following punctuation is valid:
hello, world
hello world
helloworld
Any capitalization is acceptable. For example, these are valid hello world strings:
Hello, world
hellO WORld
HELLoworlD
These strings are not valid:
Hello world
Hello(newline)world
Hello,world
Hello, Steve
Your program fails as soon as one of the following conditions are met:
- It outputs a hello world string that has been output during some earlier execution,
- output is no longer valid source code in the same language, or
- output does not contain exactly one valid hello world string.
Your program is not valid for this contest unless at least two first executions are successful. This means that the third output is allowed to be invalid. Output of your program may not be random. First execution should always create the same second output, second execution should always create the same third output, etc.
Score is calculated as amount of bytes in the source code of the initial program. Lowest score wins.
Following bonuses do apply (up to -60%):
- -5% * (N - 2), where N is the index of the execution after which your program produces invalid output. This bonus caps at -50%. If your program succeeds 12 times or more, you get the max bonus.
- -10%, if your outputs (including first source code) include all three valid punctuation alternatives.
Your submission should include the first source code, and it should also contain the outputs of the successful executions. If your program succeeds more than 12 times, add output for 12 executions.
Example
Next line is the first source code. When we execute it, it is the first execution.
hello world(some source code here)
Next line is the output from the first source code code. It is the first output.
hello, world(some source code here)
Next line is the output from the second execution. It is the second output.
helloworld(some source code here)
When we executed the first output, this program became eligible for the -10% bonus. That means we have two outputs, and one original code, which all have different punctuation. Moreover, because the second output was valid, this program is eligible for this contest.
Next line is the output from the third execution. It is the third output.
Helloworld(some source code here)
Next line is the output from the fourth execution. It is the fourth output.
hellworld(some source code here)
This output was invalid. Index of the last valid execution was 4. This program is eligible for -5% * (4 - 2) bonus and -10% bonus from the punctuation. This makes total of -20%. The length of the first source code ("hello world(some source code here)") was 34 bytes, so the final score is 27.2.
hello world
? \$\endgroup\$