Program that creates larger versions of itself (quine-variant)

  • You are to write a program that will output source code that is




    1. Larger than the original program (character wise)

    2. Will print another program larger than itself when run (i.e. the new program is also a valid answer to this challenge)



    This is code-golf, so shortest answer wins.


    @Kevin, The definition is recursive. The output should be a program whose output is larger than itself, and an answer to this question. So the output's output should be larger than the output, and the output's output's output should be even larger, etc.

    Damn. Wanted to do this in Brainfuck. Took me almost half an hour to figure out that it is impossible to do so. :D

    (or, well, at least almost impossible. YOu CAN create a Quine in BF, so this should be possible, too, but it'S too much work to bother with it)

    I think you should clarify your rules. On one hand, *any* additional code output by such a program is "obviously useless"; on the other hand, *all* additional code in the output is "useful" in that it furthers the goal of answering this challenge.

    @JohannesH. A selection of Brainfuck quines can be found here: http://esoteric.sange.fi/brainfuck/bf-source/quine/

    Sorry for destroying your challenge. `:^)`

    I think this challenge would be much better as a popularity contest than a code golf. It would allow for a lot more creativity!

    @corsiKa I will think about it.

    Naturally, such a program should be known as a quinine.

    Does a program which prints its source and a comment count? For example: (bash) `cat %0 & echo \#comment`.

    @facepalm42 Quine challenge answers are forbidden from reading their own source code, which makes comments tricky to use here.

  • Dennis

    Dennis Correct answer

    5 years ago

    GS2 (8636bd8e), 0 bytes





    This prints a single newline, which prints two newlines, which prints three newlines, et cetera.



    Try it online!


    Isn't this technically non-competing since gs2 is newer than the challenge?

    This commit predates the challenge by a month and a half. I just tested it, and it works as intended.

    How is this not a loophole???

    @MamaFunRoll Why would it be? This isn't different from an empty Retina program printing **1**, an empty Jelly program printing **0**, or an empty Stuck program printing **Hello, World!**.

    I mean I guess...

    @Dennis well it is slightly different, in that the Jelly program `0` doesn't print `00`, the stuck program `Hello, World!` doesn't print `Hello, World!Hello, World!`, etc.

    @Cyoce It just happens that a newline outputs another newline in GS2.

License under CC-BY-SA with attribution


Content dated before 7/24/2021 11:53 AM