25
2
If you are unfamiliar with hacker typer, see hackertyper.net. In short, it is a program that outputs one chunk of a code base per keystroke for comedic effect. BUT, the hackertyper.net version is far too easy to implement. It simply outputs three characters at a time from an arbitrary piece of code. For this challenge, a program must output its own source code, and print one space delimited chunk of code per keystroke.
Details
- One cannot hard code a file name for the program; it must determine its name dynamically. If the program compiles to an executable, it may append the standard file extension to the name of the executable (excluding the .exe if using Windows) and assume that the source file is within the executable's directory. For example, if a C executable is named "hacker", it should pull its source code from a file named "hacker.c" in its same directory. If a compiled program has an extension, it should be dropped before determining the name of its source code ("typer.exe" -> "typer.cs").
- Programs must contain at least 5 spaces, with at least one character between each space. This means that the smallest possible size for this challenge is 9 bytes. The spaces do not have to be crucial to the functioning of the program.
- Any formatting (indentation, new lines, etc.) must be maintained in the output. This formatting may either be printed with the code that proceeds it or follows it, what matters is that the formatting be maintained.
- Avoid using comments to satisfy the 5 space requirement unless there is no other way to implement the spaces in your language of choice.
EDIT: New lines can be used in place of, or in addition to, spaces as chunk separators.
I have not enough rep to answer, but this (http://esolangs.org/wiki/Help,_WarDoq%21) language can solve it in 9 bytes, using the Q command.
– Yotam Salmon – 2016-06-13T12:33:25.3171I'm a little confused. Should the program be a quine, or not? – Orby – 2014-09-05T04:24:41.677
8The way you've described it makes it sound as if its acceptable to read the code from the original source file, which would not be a quine. I think it would be a better contest if the program had to be an actual quine. – Orby – 2014-09-05T04:32:33.460
1
@Orby I'd say the program is not a quine in the traditional sense, regardless of if reading the source is allowed or not. Quines don't have input but these programs clearly do.
– Calvin's Hobbies – 2014-09-05T05:14:02.743@DrJPepper Your third bullet point makes it sound like any sequence of whitespace counts as a delimiter but you specifically say that only space is. Can you clarify? – Calvin's Hobbies – 2014-09-05T05:15:32.360
@Calvin's Hobbies Yes, new lines between chunks are fine as well, I'll edit it in a minute to clarify. – DrJPepper – 2014-09-05T12:58:20.703
2This challenge encourages reading of the program's own source code, a practice typically verboten in the construction of quines. – feersum – 2014-09-05T13:01:54.300
@Orby Seeing as you are allowed to read the source file, it seems you are correct in this not being a Quine. The main point of the challenge was the staggering of the output. As for the quality of the contest, I feel making such a drastic change at this point would be disrespectful to the extant answers. – DrJPepper – 2014-09-05T13:03:27.017
I'm disapppointed that newlines are now allowed to be delimiters; it simplifies the problem greatly. Most languages have easy way to read files by line, and print a whole line. My bash entry could be 12 shorter, for example, possibly shorter using a while read. – Will – 2014-09-05T17:31:57.060
@Will I didn't mean in place of, I meant in addition too. But since it was an edit, I thought honoring them should be optional. Honoring spaces is not optional. – DrJPepper – 2014-09-05T18:21:18.567
Does that mean that we can ignore newlines, as it'll make my program shorter. – matsjoyce – 2014-09-06T08:06:49.920
@matsjoyce Yes you can ignore newlines. You still need 5 spaces, but since I was not clear new lines can either be factored in or not. It was my original intention for them to count, it just slipped my mind to clarify. – DrJPepper – 2014-09-06T16:28:24.817