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

111

23

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.

PyRulez

Posted 2014-02-23T02:43:24.113

Reputation: 6 547

4@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. – ugoren – 2014-02-23T10:55:34.613

Damn. Wanted to do this in Brainfuck. Took me almost half an hour to figure out that it is impossible to do so. :D – Johannes H. – 2014-02-23T21:31:14.310

(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) – Johannes H. – 2014-02-23T22:00:29.223

8I 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. – Jason C – 2014-02-23T22:29:46.090

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

– Jason C – 2014-02-24T00:14:33.233

5Sorry for destroying your challenge. :^) – Justin – 2014-02-24T05:03:04.350

2I think this challenge would be much better as a popularity contest than a code golf. It would allow for a lot more creativity! – corsiKa – 2014-02-24T23:44:25.827

@corsiKa I will think about it. – PyRulez – 2014-02-24T23:45:16.410

33Naturally, such a program should be known as a quinine. – Jonathan Van Matre – 2014-02-25T05:05:37.893

Does a program which prints its source and a comment count? For example: (bash) cat %0 & echo \#comment. – facepalm42 – 2019-09-06T06:01:31.530

1@facepalm42 Quine challenge answers are forbidden from reading their own source code, which makes comments tricky to use here. – Ørjan Johansen – 2019-11-09T01:02:16.887

Answers

93

GS2 (8636bd8e), 0 bytes



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

Try it online!

Dennis

Posted 2014-02-23T02:43:24.113

Reputation: 196 637

3Isn't this technically non-competing since gs2 is newer than the challenge? – James – 2016-10-17T22:22:06.460

25This commit predates the challenge by a month and a half. I just tested it, and it works as intended. – Dennis – 2016-10-17T22:24:01.790

1How is this not a loophole??? – Mama Fun Roll – 2016-11-12T17:18:41.073

15@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!. – Dennis – 2016-11-12T17:21:34.367

I mean I guess... – Mama Fun Roll – 2016-11-12T17:54:59.417

@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 – 2016-12-17T21:12:40.253

2@Cyoce It just happens that a newline outputs another newline in GS2. – Esolanging Fruit – 2017-05-31T18:51:37.253

301

H9+ : 1 char

9

That's right. One character. Outputs the lyrics to 99 bottles of beer, which is a valid program. All the extraneous data does not count, but there are plenty of 9s in there.

The output of the outputted program is the lyrics to 99 bottles of beer 59 times.

This function gives the number of times the lyrics are outputted if you run the program n times (if my calculation is correct):

f(n) = 59n-1

Justin

Posted 2014-02-23T02:43:24.113

Reputation: 19 757

22One interesting feature is that it will also contain 2*59^n-2 instances of "Hello, world!", due to the "h" in "the". – AJMansfield – 2015-03-11T18:37:24.233

This is amazing. – BobTheAwesome – 2015-04-18T13:54:05.547

8Looks like you've been beat. – PyRulez – 2016-10-17T22:03:16.073

2Also, Hello, world!Hello, world! is probably a quine in H9+. – CalculatorFeline – 2017-01-05T02:41:17.103

1Isn't this invalid, because H9+ requires the accumulator to be incremented before each command except the first? – Comrade SparklePony – 2017-04-13T16:18:52.783

2@Victor Any programming languages that output on 0 chars? – Justin – 2014-02-23T06:10:46.557

But only if the output is itself a quine. – Victor Stafusa – 2014-02-23T06:12:11.137

33A 0 char program in a given language, given that it's valid, will likely output 0 characters. And since 0*x=0 for any finite value x, I can claim that my outputted program is actually 9999999999999999 times bigger than the source code. – nitro2k01 – 2014-02-23T18:33:23.923

YOu can create a langauge that ignores any input but EOF and outputs any character when reading an EOF. That'd be 0-byte length and a valid answer ;) – Johannes H. – 2014-02-24T11:58:35.793

40@JohannesH. For all(solvable) problems there exists a programming language that solves the problem in 0 chars. – Cruncher – 2014-02-24T18:48:54.633

1@Cruncher and that isn'T even hard to prove. – Johannes H. – 2014-02-24T19:01:53.360

15I still move that we name that "Cruncher's Theorem", unless it's already been discovered. – Erty Seidohl – 2014-02-25T18:31:44.070

See also: http://www.ioccc.org/1994/smr.hint

– Milo P – 2014-02-26T17:50:11.973

1

Haha, but does it count if the language was specifically designed to produce quines?

– Jason C – 2014-02-27T03:29:59.280

2

@JasonC This language was not specifically designed to produce quines. Take a look at H9+. The only possible quine is the program Hello, world!

– Justin – 2014-02-27T03:43:01.887

@Quincunx Oops, I got sidetracked by HQ9+! – Jason C – 2014-02-27T03:57:08.160

118

GolfScript, 9 chars

{.'.~'}.~

This code outputs:

{.'.~'}{.'.~'}.~

which outputs:

{.'.~'}{.'.~'}{.'.~'}.~

which outputs:

{.'.~'}{.'.~'}{.'.~'}{.'.~'}.~

and so on.

I believe this is the shortest answer in a "real" Turing-complete programming language so far.

Explanation:

Basically, the original code above is a "quine-layer": it outputs a normal quine followed by itself.

In GolfScript, any code block literal (e.g. {foo}), if left undisturbed on the stack, is a quine. Thus, on its own, {.'.~'} simply outputs itself, just like any other code block would.

The .~ at the end of the code takes the last code block on the stack, duplicates it, and executes the copy. When executed, the code .'.~' inside the code block duplicates the topmost item on the stack (i.e. the copy of itself) and appends the string .~.

At the end of the program, the GolfScript interpreter stringifies and outputs everything on the stack, which, in this case, consists of one more {.'.~'} block than in the input, plus the string .~.

Bonus:

Adding a ] before the first . (to collect all the code blocks on the stack into an array before they're duplicated) makes it grow exponentially:

{].'.~'}.~

outputs:

{].'.~'}{].'.~'}.~

which outputs:

{].'.~'}{].'.~'}{].'.~'}{].'.~'}.~

which outputs:

{].'.~'}{].'.~'}{].'.~'}{].'.~'}{].'.~'}{].'.~'}{].'.~'}{].'.~'}.~

and so on.

Ilmari Karonen

Posted 2014-02-23T02:43:24.113

Reputation: 19 513

Sorry I don't think I get the joke about the table can someone please explain? – thepiercingarrow – 2016-03-27T03:22:08.863

1Is "real" in quotes because HQ9+ is not real or because GolfScript is not real, or both? – Roger Pate – 2016-09-13T08:37:39.003

1

@thepiercingarrow the source code resemble this

– Rod – 2016-11-16T14:47:14.840

202{].'.~'}.~︵ ┻━┻ – nitro2k01 – 2014-02-23T18:34:23.443

2http://bit.ly/1cQXJyA – Jason C – 2014-02-26T20:33:06.513

2@nitro2k01 my first thoughts exactly :D – Songo – 2014-02-27T12:50:00.317

@nitro2k01: Flip back that table /(@.@)/ – Ray – 2014-04-22T12:13:09.093

109

Java 7: 0 chars



Save as file Blank.java. If you save it as any other file, replace any instance of Blank with the appropriate file name.

Then, run in command line via first compiling, then running. If compiling fails, stop.

I list this as Java 7 because it might output differently for different versions of Java.

First few outputs (outputted to stderr):

Error: Could not find or load main class Blank
Blank.java:1: error: class, interface, or enum expected
Error: Could not find or load main class Blank
^
Blank.java:1: error: reached end of file while parsing
Error: Could not find or load main class Blank
                                              ^
2 errors
Blank.java:1: error: class, interface, or enum expected
Blank.java:1: error: class, interface, or enum expected
^
Blank.java:1: error:  expected
Blank.java:1: error: class, interface, or enum expected
                          ^
Blank.java:1: error:  expected
Blank.java:1: error: class, interface, or enum expected
                                     ^
Blank.java:1: error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
Blank.java:1: error: class, interface, or enum expected
                                          ^
  (use -source 1.4 or lower to use 'enum' as an identifier)
Blank.java:1: error: = expected
Blank.java:1: error: class, interface, or enum expected
                                               ^
Blank.java:2: error:  expected
Error: Could not find or load main class Blank
     ^
Blank.java:2: error: ';' expected
Error: Could not find or load main class Blank
      ^
Blank.java:2: error: = expected
Error: Could not find or load main class Blank
                      ^
Blank.java:2: error: = expected
Error: Could not find or load main class Blank
                                   ^
Blank.java:2: error:  expected
Error: Could not find or load main class Blank
                                              ^
Blank.java:3: error: = expected
^
^
Blank.java:3: error: ';' expected
^
 ^
Blank.java:4: error: illegal start of type
Blank.java:1: error: reached end of file while parsing
     ^
Blank.java:4: error: = expected
Blank.java:1: error: reached end of file while parsing
          ^
Blank.java:4: error: illegal start of type
Blank.java:1: error: reached end of file while parsing
           ^
Blank.java:4: error:  expected
Blank.java:1: error: reached end of file while parsing
            ^
Blank.java:4: error: = expected
Blank.java:1: error: reached end of file while parsing
          ^
Blank.java:4: error: illegal start of type
Blank.java:1: error: reached end of file while parsing
           ^
Blank.java:4: error:  expected
Blank.java:1: error: reached end of file while parsing
            ^
Blank.java:4: error: = expected
Blank.java:1: error: reached end of file while parsing
              ^
Blank.java:4: error: ';' expected
Blank.java:1: error: reached end of file while parsing
                   ^
Blank.java:4: error: = expected
Blank.java:1: error: reached end of file while parsing
                                 ^
Blank.java:4: error:  expected
Blank.java:1: error: reached end of file while parsing
                                        ^
Blank.java:4: error: = expected
Blank.java:1: error: reached end of file while parsing
                                         ^
Blank.java:4: error: ';' expected
Blank.java:1: error: reached end of file while parsing
                                              ^
Blank.java:5: error:  expected
Error: Could not find or load main class Blank
     ^
Blank.java:5: error: ';' expected
Error: Could not find or load main class Blank
      ^
Blank.java:5: error: = expected
Error: Could not find or load main class Blank
                      ^
Blank.java:5: error: = expected
Error: Could not find or load main class Blank
                                   ^
Blank.java:5: error:  expected
Error: Could not find or load main class Blank
                                              ^
Blank.java:6: error: = expected
                                              ^
                                              ^
Blank.java:6: error: ';' expected
                                              ^
                                               ^
Blank.java:7: error: reached end of file while parsing
2 errors
        ^
30 errors

Justin

Posted 2014-02-23T02:43:24.113

Reputation: 19 757

4@V-X: Easy, then: this is not a java(1) program, but rather a program for the javac(1) interpreter! :-) – wchargin – 2017-01-03T13:30:40.117

@wchargin Now we need an answer for the ld(1) interpreter... – None – 2018-12-06T11:34:06.077

23"You are to write a program that will output source code that is" The output is arguably not source code. And furthermore, depending on the definition of output (whether output must come specifically from stdout) nothing is actually output. – nitro2k01 – 2014-02-23T18:48:31.813

44@nitro2k01 I quote the same: "You are to write a program that will output source code". Anything is source code. But only some things are valid source code. Additionally, it was not specified what is considered output, so I am allowed freedom there. – Justin – 2014-02-23T18:50:36.400

One problem, it isn't getting larger. It is obviously useless, so each iteration is 0 characters, and not larger. – PyRulez – 2014-02-23T21:33:55.283

2@PyRulez But they aren't all useless. Many characters contributes to the output of the program. – Justin – 2014-02-23T21:35:07.003

1But the output is also useless. You see, I make questions exploit proof by including unclear words, so when people try to exploit, instead of admitting it, I can just exploit it myself. – PyRulez – 2014-02-23T21:38:29.083

16@PyRulez That's right. I exploited your rules. You don't need to accept this answer. When I posted this, I knew that a controversy would follow, complete with many up and down votes. I decided that it would be worth it, though. – Justin – 2014-02-23T21:40:17.420

Except that I don't care if you exploited it. Another vague rule counts you out! Yeah! (You are going to try to exploit all my questions now, aren't you?) – PyRulez – 2014-02-23T21:46:03.957

1@PyRulez This would be a good answer for your other question, but that was closed (and I voted to close it) :-). – Justin – 2014-02-23T21:50:47.503

+1 I had a similar idea (I was trying to do it with GCC but GCC has the difficulty of stopping after unrecoverable errors). The rules don't specify that source code must be valid. The "useless" term in the rule is also very ambiguous (see my comment on answer). – Jason C – 2014-02-23T22:54:10.943

the problem with this kind of "smartass" solutions is that they severy reduce the motivation for others to think and send inspiring answers. And that is what its all about here, isn't it? – blabla999 – 2014-02-24T07:47:50.983

29Are you sure that the program itself printed the output? Wasn't that only the compiler? The program gets never compiled and itself is not interpreted nor executed, thus it wasn't able to produce any output. – V-X – 2014-02-24T08:25:32.607

12@blabla999 I disagree - people don't try these challenges because someone else does something crazy. We just challenge ourselves to do it some other way. As Mark Rosewater says, "Restrictions breed creativity" – corsiKa – 2014-02-24T23:40:48.930

80

HQ9+, HQ9++ and similars, 2 characters

QQ

This is the output:

QQQQ

Victor Stafusa

Posted 2014-02-23T02:43:24.113

Reputation: 8 612

38I saw this and thought "Oh no, nothing can beat this." I started trying to come up with something, then it hit me. So I posted an answer. – Justin – 2014-02-23T06:09:18.377

1@Quincunx Bravo, upvoted your answer. – Victor Stafusa – 2014-02-23T06:10:03.860

This program has a very fast rate of growth. At generation n, your program length is n^n where ^ is the exponent operator. – Justin – 2014-02-23T18:06:17.350

4@Quincunx No, I think it's 2^2^n, where the initial program is generation 0. The length recurses m -> m^2. – Vortico – 2014-02-23T20:11:48.197

3@Vortico Good point. Even though I said it wrong, I meant: At code-length n, the output becomes n^n. However, that is false; when the code-length is n, the output's length is n^2 – Justin – 2014-02-23T21:00:52.897

2It is funny though because even the first two iterations are possible contenders for this question. – PyRulez – 2014-02-23T21:47:54.010

29

Ruby 27

A very slightly modified version of this (via):

puts <<3*3,3
puts <<3*3,3
3

The number of times that puts-line is printed grows exponentially.

$ ruby quine.rb | ruby | ruby
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
puts <<3*3,3
3

$ ruby quine.rb | ruby | ruby | ruby | ruby | ruby | ruby | ruby | wc -l
    3283

daniero

Posted 2014-02-23T02:43:24.113

Reputation: 17 193

17Answer inspired by the Kaiser Chiefs – Ben Jackson – 2014-02-23T20:06:35.943

25

Lambda Calculus - 29

A simple lambda term

(λu.(u u)(u u))(λu.(u u)(u u))

Reducing this term by one beta reduction yields

((λu.(u u)(u u))(λu.(u u)(u u)))((λu.(u u)(u u))(λu.(u u)(u u)))

And so on and so on. It's a simple variant on the classic (λu.u u)(λu.u u) which is a quine in lambda calculus, double self application here means we get twice the output.

Daniel Gratzer

Posted 2014-02-23T02:43:24.113

Reputation: 953

Why not just (λu.u u)(λu.u u u)? – Esolanging Fruit – 2018-07-24T23:16:22.337

7I'd argue that in lambda calculus, "running" a lambda term means computing its normal form, not performing a single beta reduction. Also, a term can contain multiple redexes, therefore "reducing a single redex" is an ambiguous operation. – Petr Pudlák – 2014-02-24T19:17:29.627

2You're right, but since this term has no normal form it makes sense to talk about this in terms of small step reduction. Since lambda calculus lacks any inherent set evaluation, I can just define "running" it to be reducing a single redex top level redex with call-by-name semantics no? – Daniel Gratzer – 2014-02-24T19:54:04.190

3Well, terms with no normal form correspond to non-terminating programs. And the problem with top level redex is that a term can have two redexes, neither one being a sub-term of another. You could pick some criterion which one to reduce, but I'd say that then you're getting very far from the standard lambda calculus semantics. (Anyway I appreciate your novel idea.) – Petr Pudlák – 2014-02-24T19:56:43.247

2(λx.x x x)(λx.x x x) :20 – Fabio F. – 2014-02-24T22:10:26.803

2(λx. x x)(λx. x x x) reduces to that in a single step – Ben Millwood – 2014-02-26T21:56:47.143

1shouldn't you write (λu.u u)(λu.(u u)(u u)) instead? it is shorter, and reduces the same. – proud haskeller – 2014-08-15T19:05:35.997

23

SH script, 9

cat $0 $0

Grows at exponential rate.

Either run as sh whatever.sh or set it as executable.

Windows version is here.

Jason C

Posted 2014-02-23T02:43:24.113

Reputation: 6 253

2At the time of me writing this comment, the Quine Wiki page says that reading from the filesystem is cheating. – Lord Ratte – 2016-12-07T14:32:28.060

3@LordRatte On the other hand, the challenge wasn't to write a quine. – Jason C – 2016-12-07T23:53:59.260

20

dc 11

Quite simple:

6579792
dfP

The first line is repeated once every generation:

$ dc growing_quine.dc
6579792
6579792
dfP

$ dc growing_quine.dc | dc | dc 
6579792
6579792
6579792
6579792
dfP

The last line consists of the following instructions: d duplicates the last value put on the stack (6579792) (so that we get one more copy each time we run it), f prints the whole stack (which is a bunch of that same number) and P prints the number (6579792) out as a byte stream, which displays as dfP.

daniero

Posted 2014-02-23T02:43:24.113

Reputation: 17 193

16

redcode (recursive solution)

This is the code of the easiest warrior writable in redcode, the famous Imp:

MOV 0, 1

When executed, the code writes a copy of its single instruction at the next address in memory; then executes it, etc.

Thomas Baruchel

Posted 2014-02-23T02:43:24.113

Reputation: 1 590

15

Python 3 - 55

print(open(__file__).read())
f=lambda:print('f()')
f()

This could be made shorter by replacing __ file__ with a single character filename and saving the file as that, but I felt this answer was more in the spirit of the question. After one iteration it outputs:

print(open(__file__).read())
f=lambda:print('f()')
f()
f()

user1547129

Posted 2014-02-23T02:43:24.113

Reputation: 167

3

This isn't a quine. See the definition.

– Petr Pudlák – 2014-02-24T19:13:16.423

14@PetrPudlák Nor are any programs in this question. This is a quine-variant problem, not strict quining. – AJMansfield – 2014-02-25T02:22:56.660

6

Smalltalk, 125 61 57

The golf version looks almost unreadable so I'll explain first (and use real identifiers).

This is a variant of the "weirdest-way-to-produce-a-stack-overflow" self modifying method.

The method prints out a hello message, and its current source (for the demonstration only). Then, the code is modified to output a longer string and installed. Finally, the new code is called recursively.

In order to protect myself from an immediate runaway, it lets the user confirm in each cycle.

compile in Object:

eatMe_alice
   |msg mySource|

   mySource := thisContext method source.

   '**** Hello Alice' printCR.
   '  ---- my current code is:' printCR.
   mySource printCR.
   '  ---------------' printCR.

   (UserConfirmation confirm:'Again? ') ifTrue:[
       Object compile:
            (mySource
                copyReplaceString:'Hello ','Alice'
                withString:'Hello ','Alice !').
       self eatMe_alice
   ]

start the show by sending "eatMe_alice" to any Object; nil will do:

nil eatMe_alice

A nice variant is to not call the new code recursively, but instead iteratively, by unwindig the call stack and reentering into the new method. This has the advantage of not leading to a recursion exception. To do this, replace the recursive call ("self eatMe_alice") by:

thisContext resend

Golfing:

Obviously, printing and self calling was not asked for, so the shortest (for golf) is to simply append a comment to my own source and return it. As a side effect, it also gets installed for the next call...

x|s|Object compile:(s:=thisContext method source,'""').^s

blabla999

Posted 2014-02-23T02:43:24.113

Reputation: 1 869

5

SH script, 12 8 7

Store a file with

sed p *

in its own, empty directory and run from this directory using sh [file] or set executable.


Old alternative with 8 characters, but doesn't need its own directory. Store a file with

sed p $0

and run using sh [file] or set executable.

Old alternative with 12 characters:

sed -i- p $0

This will actually output to the program file itself, but where to output was not specified. Replicates itself at an exponential rate.

Jens Erat

Posted 2014-02-23T02:43:24.113

Reputation: 261

1You might still have chance using ed, didn't want to look through its man page... – Jens Erat – 2014-02-24T10:49:29.327

4

JavaScript, 41, 40 chars

function f(){console.log(f+"f(f())")}f()

The first time you run it it outputs itself with another ;f() at the end. Subsequent runs of the output results in each "input" source printed twice.

alert would be shorter than console.log but I don't consider multiple alert dialogs to be "the" output while it seems reasonable to call multiple lines in the console as an output.

DocMax

Posted 2014-02-23T02:43:24.113

Reputation: 704

You can save one byte with "f(f())" instead of "f();f()" – Hedi – 2016-11-12T15:40:27.807

This doesn't seem to work for me... – Destructible Lemon – 2016-11-12T22:27:51.217

3

J, 1 byte

'

Try it online!

The open quote gives, obviously, the open quote error:

|open quote
|   '
|   ^
|[-1] /home/runner/.code.tio

Note that, by the nature of J interpreter, the errors are printed to STDOUT, not STDERR.

When the above is run as code, it prints:

|open quote
|   |   '
|       ^
|[-2] /home/runner/.code.tio

Then

|open quote
|   |   |   '
|           ^
|[-2] /home/runner/.code.tio

and so on. Each time the code runs, the second line is left-padded with four bytes |   , fulfilling the requirement of this challenge.

J, proper quine variant, 25 bytes

echo,~'echo,:~(,quote)'''

Try it online!

Outputs

echo,:~(,quote)'echo,:~(,quote)'

And then it outputs itself twice, on separate lines:

echo,:~(,quote)'echo,:~(,quote)'
echo,:~(,quote)'echo,:~(,quote)'

then

echo,:~(,quote)'echo,:~(,quote)'
echo,:~(,quote)'echo,:~(,quote)'
echo,:~(,quote)'echo,:~(,quote)'
echo,:~(,quote)'echo,:~(,quote)'

and so on.

The first output is a simple variant of standard J quine. The added ,:~ concatenates itself vertically, where the resulting 2D array is printed as two rows of the same string.

Bubbler

Posted 2014-02-23T02:43:24.113

Reputation: 16 616

3

Runic Enchantments, 6 bytes

"'<S@>

Try it online!

This one was weird. All I had to do was remove a ~ from the original quine found by Jo King.

Every additional run appends another < to the end, e.g.:

"'<S@><<<<<<<<<

All of which do nothing.

Draco18s no longer trusts SE

Posted 2014-02-23T02:43:24.113

Reputation: 3 053

3

Evoloop, 9×9 rectangle (81 cells)

The Evoloop cellular automaton included with Golly supports patterns which replicate themselves in a "quine-like" way. Specifically, these patterns each contain a "program"; a pattern reproduces itself by first executing the program (which creates the "body" of the daughter), and then by copying the program into the daughter.

The above applies to the more famous "Langton's Loops" cellular automaton as well as Evoloop, but Evoloop has an interesting difference, which is that it's easy to create a pattern which grows in each successive generation.

(Much more interesting, in my opinion, is the fact that Evoloop is a simple cellular automaton which contains patterns which reproduce themselves and evolve in a very life-like manner! I think the only known cellular automata which do this are Evoloop and its descendants. A shortcoming of Evoloop, however, is that there is one particular "best" genome; evolution always eventually converges to this one genome.)

Now, there are two shortcomings to this submission. One is that it's not clear what the "output" of a cellular automaton is. But I think that a self-reproducing automaton is "close enough" to being a quine; it's certainly no less interesting! The other shortcoming is that these patterns don't merely create a single copy of themselves; each copy of the original pattern attempts to create infinitely many copies of itself, and these copies end up interacting with each other in a destructive manner. So, I think I've met the requirements of this challenge in spirit, but not in letter.

Without further ado, the pattern is:

022222220
270170172
212222202
202000212
272000272
212000202
202222212
271041032
022222250

Here's the pattern again, in a format that can be copied and pasted into Golly:

x = 9, y = 9, rule = Evoloop
.7B$BG.AG.AGB$BA5B.B$B.B3.BAB$BGB3.BGB$BAB3.B.B$B.5BAB$BGA.DA.CB$.6BE
!

Okay, but what does it look like? It looks like this:

A pattern in a cellular automaton which creates increasingly large copies of itself.

In the above animation, you can see the initial pattern create a larger daughter, which creates a larger granddaughter, then a larger great-granddaughter, and finally an even larger great-great-granddaughter which starts to construct a yet larger third-great-granddaughter. If you ran this pattern for a long time, it would keep going on like this forever (or perhaps they would eventually be overtaken by the evolved organisms, which are capable of reproducing much faster; I'm not sure).

Tanner Swett

Posted 2014-02-23T02:43:24.113

Reputation: 531

3

Windows .BAT, 25

@COPY %~nx0+%~nx0 CON>NUL

Grows at exponential rate.

Equivalent SH version here.

Jason C

Posted 2014-02-23T02:43:24.113

Reputation: 6 253

3

reticular, 11 bytes, noncompeting

"'34'coo1o;

This is the standard quine framework, except an extra 1 is printed after each iteration. Try it online!

First few outputs:

"'34'coo1o;
"'34'coo1o;1
"'34'coo1o;11
"'34'coo1o;111

Conor O'Brien

Posted 2014-02-23T02:43:24.113

Reputation: 36 228

3

Microscript II, 6 bytes

Noncompeting, language postdates the challenge.

"qp"qp

The first iteration adds an extra qp to the end, and each successive iteration adds an extra copy of this original program to the beginning.

SuperJedi224

Posted 2014-02-23T02:43:24.113

Reputation: 11 342

2

EcmaScript 6 (51 bytes):

(_=x=>'(_='+_+Array(x++).join(','+_)+')('+x+')')(2)

It produces a longer version of itself, which can produce a longer version of itself, which can produce a longer version of itself, etc. ...

Toothbrush

Posted 2014-02-23T02:43:24.113

Reputation: 3 197

2

PHP, 38

<?echo fgets(fopen(__FILE__,'r')).';';

It will add a semicolon at each run.

ComFreek

Posted 2014-02-23T02:43:24.113

Reputation: 376

Are the semicolons useless code? – Justin – 2014-02-23T18:00:43.947

3@Quincunx They are, you are right. However, what would you consider useful code? – ComFreek – 2014-02-23T18:03:17.183

Maybe you could put in in the ';'. Then you'd get longer outputs. – Justin – 2014-02-23T18:03:56.180

1why not <?=fgets(fopen(__FILE__,'r')).';';? – Ismael Miguel – 2014-02-24T23:54:57.340

1;<?echo fgets(fopen(__FILE__,'r')); – jimmy23013 – 2014-10-15T08:59:11.627

2

ECMAScript 6 (38 Characters)

(f=_=>'(f='+f+')();(f='+f+')();')();

Which outputs:

(f=_=>'(f='+f+')();(f='+f+')();')();(f=_=>'(f='+f+')();(f='+f+')();')();

Edit

You could do (28 characters):

(f=_=>'(f='+f+')();'+f())();

However it will recurse infinitely and never return anything... but this can be solved by doing something like this (42 characters):

(f=_=>_?'(f='+f+')('+_+');'+f(_-1):'')(3);

Which will output:

(f=_=>_?'(f='+f+')('+_+');'+f(_-1):'')(3);(f=_=>_?'(f='+f+')('+_+');'+f(_-1):'')(2);(f=_=>_?'(f='+f+')('+_+');'+f(_-1):'')(1);

MT0

Posted 2014-02-23T02:43:24.113

Reputation: 3 373

3+_+ =_= +1 for emoticons – TuxCrafting – 2016-10-18T12:21:09.953

2

Common Lisp, 16 Characters

(print `(or ,-))

Granted, it's interactive-only, but being able to reference the current top-level form is probably the single best way to minimize a non-trivial program that meets the specification.

What would be really interesting is what blows up the fastest. Maybe something like

(print `(progn ,@(loop repeat (length -) collect -)))

Stuart Olsen

Posted 2014-02-23T02:43:24.113

Reputation: 161

+1 For Common Lisp. Looks to me like you can skip \`` and,`? – daniero – 2014-02-26T13:55:58.697

@daniero Without the quotation, it just prints the original program, never growing. At that point, you may as well omit the or, too: (print -) – Stuart Olsen – 2014-02-26T20:14:52.813

2

Julia, 66 chars

x="print(\"x=\$(repr(x))\\n\$x;\"^2)";print("x=$(repr(x))\n$x;"^2)

Output (134 chars):

x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);

Result of executing the result (268 chars):

x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);

next result (536 chars):

x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);

Next result (1072 chars):

x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);x="print(\"x=\$(repr(x))\\n\$x;\"^2)"
print("x=$(repr(x))\n$x;"^2);

I hope this is according to the rules.

It produces larger output, and the output itself is valid source code that produces larger output again.

M L

Posted 2014-02-23T02:43:24.113

Reputation: 2 865

Will the output, when ran, produce a valid entry? – PyRulez – 2015-06-30T01:11:08.517

In the first example the output is valid code. It’s a string literal containing 5 periods. In the second example, entering the julia prompt itself wouldn’t do anything. I just thought that just giving the repl actually a newline character by hitting enter produces a longer output than the input. – M L – 2015-06-30T01:24:02.630

Will "....." produce a larger version of itself? – PyRulez – 2015-06-30T01:25:45.663

Ah, now I understand. I just noticed it had to be recursive... time to correct my solution. Thanks for the hint. – M L – 2015-06-30T01:28:09.623

Essentially its a quine that makes itself larger. – PyRulez – 2015-06-30T01:46:44.337

1I guess the code is according to the rules now. – M L – 2015-07-12T02:26:35.587

2

05AB1E, 15 bytes, noncompeting

0"DÐ34çý"DÐ34çý

Try it online!

Prints 0"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý,
which prints 0"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý"DÐ34çý,
etc.

Oliver Ni

Posted 2014-02-23T02:43:24.113

Reputation: 9 650

Both instances of DD can be replaced by Ð. – Emigna – 2016-11-11T09:30:45.113

2Why noncompeting? – MD XF – 2017-05-25T20:10:27.077

1

Help, WarDoq!, 1 byte.

H

Prints Hello, World!.

Other characters than H are valid (and safe) source code (that print other variants of Hello World).

n4melyh4xor

Posted 2014-02-23T02:43:24.113

Reputation: 507

Also works in (variants of) HQ9+. – CalculatorFeline – 2017-01-05T02:39:31.717

@CalculatorFeline in HQ9+ this wouldn't continue to grow. – Martin Ender – 2017-04-13T09:18:24.693

1

Charcoal, non-competing, 32 bytes

A´α´´´A´F´α´⁺´´´´´ι´αaα´AFα⁺´´ια

Try it online!

Explanation:

first, go check out this answer on the quine challenge and its explanation.

This program is that program, but with the letter a at the end of the string variable.

A                      α            Assign to a
 ´α´´´A´F´α´⁺´´´´´ι´αa             "α´AFα⁺´´ιαa", but with ´ escape character with each
                                     character, except a
                                     these are the variable being assigned to, and the
                                     rest of the program that is not the string.

                         ´A         Print A to the grid. current grid: "A"
                            Fα⁺´´ι  For each character in a, print ´ + character
                                     this results in the escaped version of the string
                                     which is the literal string that is assigned at the 
                                     start, plus a escaped. current grid state: "A´α´´´A´F´α´⁺´´´´´ι´α´a"

                                   α Print a ("α´AFα⁺´´ιαa"), which is the commands after
                                     the string assignment. final grid state vvv:
                                                  "A´α´´´A´F´α´⁺´´´´´ι´α´aα´AFα⁺´´ιαa"

[implicitly print the grid: "A´α´´´A´F´α´⁺´´´´´ι´α´aα´AFα⁺´´ιαa", the new program]

This new program works in the same way, except for two things:

  • the "a" is escaped (which has no effect, as "a" escaped is "a")

  • there is an "a" at the end of the program. this "a" will write an extra "a" after the source is produced. thus the program grows slowly

Destructible Lemon

Posted 2014-02-23T02:43:24.113

Reputation: 5 908

1

C, 116 149 197 189 bytes

i;main(a){printf(a="i;main(a){printf(a=%c%s%1$c,34,a,i+2);for(i=%d;i--;)",34,a,i+2);for(i=1;i--;)printf(a="printf(a=%c%s%1$c,34,a,34),",34,a);printf(a="0;printf(a=%c%s%1$c,34,a);}",34,a);}

How it works

  • main(a){ declares the main function with an untyped variable a.
  • The first printf prints the existing source code and a for loop. An integer is printf'd into the for loop. This is how the multi-quine works - each time the quine program is called, it increments d, making the for loop run more times.
  • The second printf is inside the for loop and prints itself, so each time the quine program is called, there are more printf's, therefore generating bigger versions of itself. Be warned that this growth is exponential, due to the for loop incrementation and the multiple printfs.
  • The third printf prints the remaining source code.

Requires POSIX.

MD XF

Posted 2014-02-23T02:43:24.113

Reputation: 11 605

1

Gol><>, 5 bytes

#H}"'

This, I believe, is the smallest growing quine possible in Gol><>. It duplicates the #H} over and over...

Try it online!

KrystosTheOverlord

Posted 2014-02-23T02:43:24.113

Reputation: 681

1

AsciiDots, 20 bytes

($'#a_$93#"$_@("_$-.

Try it online!


First run

Sends a dot leftward, printing the characters (@_$ with a literal and ' from the ASCII value 39. The dot then turns around and interprets the path as a string, printing the rest of the line.

(@_$'#a_$93#"$_@("_$-.


Subsequent runs

Prints (@_$' again, as well as a 0, thanks to the added @_ from the first run. The 0 ends up on the right side of the ' symbol, which means that all 0s printed in a previous run carry over. The dot safely ignores the additional 0s on its path.

(@_$'0#a_$93#"$_@("_$-.

(@_$'00#a_$93#"$_@("_$-.

(@_$'000#a_$93#"$_@("_$-.

Alion

Posted 2014-02-23T02:43:24.113

Reputation: 965

1

Underload, 9 bytes

(:::aSSS):^

Modification on the standard underload quine, which is (:aSS):aSS. First, I changed the second :aSS into :^ since it still runs the same code (by duplicating and then running the top item of the stack, which is the stuff inside the bracket) whilst saving bytes. Then I added another S to make it so the program gets longer, and added two more :s to make it so the program it produces doesn't error.

Try it Online!

EdgyNerd

Posted 2014-02-23T02:43:24.113

Reputation: 1 106

1

Bash, 14 bytes

cat $0&cat $0&

Try it online!

facepalm42

Posted 2014-02-23T02:43:24.113

Reputation: 405

1

Keg, 18 15 14 13SBCS 11 10SBCS 9SBCS 6SBCS bytes

`④⑩`④⑩

Try it online!

I've gone and done it now! No more ascii around here now folks. This will print:

`④⑩`④⑩④⑩

Which will print:

`④⑩`④⑩`④⑩`④⑩④⑩

Which prints:

`④⑩`④⑩`④⑩`④⑩`④⑩`④⑩④⑩④⑩

And so on.

Answer History

9 bytes

`::.,`⑵④⑩

This uses the same approach as the 10 byte answer

Explained

`::.,`⑵④⑩
`::.,`      #Push the string `::.,`
      ⑵     #Double the string
        ④⑩  #Print raw then nice without popping

10 bytes

`::.,`⑵:.,

This prints:

`::.,::.,`::.,::.,

Which prints:

`::.,::.,`::.,::.,`::.,::.,`::.,::.,

11 bytes

`::.,`6*:.,

This prints:

`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,

Which prints:

`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,`::.,::.,::.,::.,::.,::.,

And so on

Try it online!

13 bytes

`::.,`!⑨*:(.,

Try it online!

This prints:

`::.,::.,`::.,::.,

Which prints:

`::.,::.,`::.,::.,`::.,::.,`::.,::.,

And so on.

14 bytes

`::.,(:.,)`:.,

Try it online!

This will create pretty much the same chain as the previous 15-byter.

15 bytes

`::.,(::.,)`:.,

This prints:

`::.,(::.,)`::.,(::.,)

Which prints:

`::.,(::.,)`::.,(::.,)`::.,(::.,)`::.,(::.,)

And so on.

Try it online!

18 bytes

`:::.,(!2/|.,)`:.,

Try it online!

This will print

`:::.,(!2/|.,)`:::.,(!2/|.,)

Which in turn prints:

`:::.,(!2/|.,)`:::.,(!2/|.,)`:::.,(!2/|.,)`:::.,(!2/|.,)

Which then prints:

`:::.,(!2/|.,)`:::.,(!2/|.,)`:::.,(!2/|.,)`:::.,(!2/|.,)`:::.,(!2/|.,)`:::.,(!2/|.,)`:::.,(!2/|.,)`:::.,(!2/|.,)

And so on.

Try it online!

Lyxal

Posted 2014-02-23T02:43:24.113

Reputation: 5 253

1

Python 2, 38 37 36 34 bytes

-1 bytes thanks to Jo King

s='print"s=%r;exec s;"%s+s';exec s

Try it online!


Python 3.8 (pre-release), 39 38 36 bytes

exec(s:='print("exec(s:=%r);"%s+s)')

Try it online!

Mukundan

Posted 2014-02-23T02:43:24.113

Reputation: 1 188

1

BATCH, 26

Place this code in any .bat file and it will continue to execute (in an infinite loop) and the file will grow as well.

echo echo %0 ^>^> %0 >> %0

ub3rst4r

Posted 2014-02-23T02:43:24.113

Reputation: 282

This doesn't quite work, %0 is the command used to invoke the script, which may not have a .BAT extension. You can use %~nx0 to get the full filename of the batch file. – Jason C – 2014-02-24T00:06:17.697

@JasonC AFAIK, it doesn't need the .bat to be executed. If the filename is execute.bat, you can enter either execute or execute.bat. Both will work. – ub3rst4r – 2014-02-24T01:59:48.490

The file itself needs to have a .bat extension to execute but you can leave the extension off when you execute it (when you type a command with no extension, Windows tries .com, .exe, then .bat in that order). If the filename is hello.bat, then >> %0 will write a file named hello, which isn't the original hello.bat (and can't be executed). – Jason C – 2014-02-24T02:40:58.240

1

PYG (6)

P(Q,Q)

Prints it's own source code, separated by newlines. The second generation would be

P(Q,Q)
P(Q,Q)

and so forth.

ɐɔıʇǝɥʇuʎs

Posted 2014-02-23T02:43:24.113

Reputation: 4 449

1

OIL, 83 bytes

0
0
1
1
1
4
1
11
4
1
11
1
2
2
1
12
18
10
18
1
32
22
1
18
26
4
26
8
18
11
6
17
4
26

It first prints two lines with a zero in them, and then compares each line to line 1, if they're equal (which is the case when the file is exhausted), we print what's in cell 26. The resulting output will look the same, except with an added 33, which doesn't do anything. Next time, another line will be added, and so on.

L3viathan

Posted 2014-02-23T02:43:24.113

Reputation: 3 151

0

Pushy, 7 bytes

95&34_"

Non-competing as the language postdates the challenge. This outputs:

95 95 34
__"

which in turn outputs:

95 95 34
95 95 34
__"

and so on. After ~5 runs it looks like this:

95 95 34 95 95 34 95 95 34 95 95 34
95 95 34 95 95 34 95 95 34 95 95 34
__"__"__"__"
95 95 34 95 95 34 95 95 34 95 95 34
95 95 34 95 95 34 95 95 34 95 95 34
__"__"__"__"

FlipTack

Posted 2014-02-23T02:43:24.113

Reputation: 13 242

0

k

41 bytes

f:{{(2*#x)#x}"f:",x,";`0:f@$f;"};`0:f@$f;

This program prints a copy of itself, and then doubles it. Thus it grows.

33 bytes

`0:{,//$("`0:";o;"[";x;"1];")}[1]

This program prints itself, but with an ever-growing number as the argument. This works in the closed-source interpreter.

zgrep

Posted 2014-02-23T02:43:24.113

Reputation: 1 291

0

Alice, 14 bytes

" <@o&h:2d+2..

Try it online!

Subsequent versions will have an increasing number of spaces after the ".

Explanation

" <@o&h:2d+2.."   Push the code points of the source code, except for the 
                  quotation marks.
<                 Send the IP back west.
"..2+d2:h&o@< "   Push the code points of the source code, except for the
                  quotation marks, in reverse.
..                Make two copies of the space. One will be the additional
                  space, one will be turned into the quotation mark.
2+                Add two, to turn 32 (space) into 34 (quote).
d                 Push the stack depth. This is about twice the number of characters
                  we want to print, because there's still the first copy of the source
                  on the stack. But it's two less than twice that number, because the
                  additional space and the quote aren't duplicated.
2:                Halve the value.
h                 Increment to account for the space and quote.
&                 Repeat the next command that many times.
o                 Print that many characters from the top of the stack.
@                 Terminate the program.

Martin Ender

Posted 2014-02-23T02:43:24.113

Reputation: 184 808

0

shortC, 99 bytes

i;ARa="i;ARa=%c%s%c,34,a,34,i+2);Oi=%d;i--;)",34,a,34,i+2);Oi=2;i--;)Ra="Ra=%c%s%c,34,a,34",34,a,34

MD XF

Posted 2014-02-23T02:43:24.113

Reputation: 11 605

0

Java 8, 92 bytes

v->{String s="v->{String s=%c%s%1$c+1;return s.format(s,34,s);}//";return s.format(s,34,s);}

Try it online.

Outputs (4 bytes larger):

v->{String s="v->{String s=%c%s%1$c+1;return s.format(s,34,s);}//"+1;return s.format(s,34,s);}//

Try first output program.

Which outputs (2 bytes larger):

v->{String s="v->{String s=%c%s%1$c+1;return s.format(s,34,s);}//1"+1;return s.format(s,34,s);}//1

Try second output program.

Which outputs (2 bytes larger):

v->{String s="v->{String s=%c%s%1$c+1;return s.format(s,34,s);}//11"+1;return s.format(s,34,s);}//11

Try third output program.

etc. (2 bytes larger every new program)

Explanation:

-part:

  • The String s contains the unformatted source code.
  • %s is used to input this String into itself with the s.format(...).
  • %c, %1$c and the 34 are used to format the double-quotes.
  • s.format(s,34,s) puts it all together

Challenge part:

  • Unformatted source code contains +1 and // to make the output program larger and compilable.
  • +1 adds a 1 to both the unformatted and formatted program.

Kevin Cruijssen

Posted 2014-02-23T02:43:24.113

Reputation: 67 575

0

Befunge-98 (FBBI), 38 bytes

::3a*3+-8jrfjj2,g0_0g,"+2",,1+:3d*`#@_

Try it online!

Wisław

Posted 2014-02-23T02:43:24.113

Reputation: 554

0

Python 3, 54 chars

print((lambda s:s%s)('print((lambda s:s%%s)(%r)*2);'))

I simply modified this quine. You can try it simply doing python this.py | python | python ... | python many times.

Edit: found this problem on the homepage and discovered too late that it is old.

Andrea Ciceri

Posted 2014-02-23T02:43:24.113

Reputation: 301

1There's no issue solving old challenges. – PyRulez – 2019-07-16T00:39:32.920

0

C (gcc), 132 bytes

It's not often you get to recycle answers from other questions.

x;*s="x;*s=%c%s%c;main(i){for(i=__LINE__;i--;puts(&x));printf(s,34,s,34);}";main(i){for(i=__LINE__;i--;puts(&x));printf(s,34,s,34);}

Try it online!

gastropner

Posted 2014-02-23T02:43:24.113

Reputation: 3 264

0

Haskell, 155 bytes

g=putStrLn("n=1"++show n++('-'<$[1..n]));main=(\s->putStr s>>print s>>g)$"g=putStrLn(\"n=1\"++show n++('-'<$[1..n]));main=(\\s->putStr s>>print s>>g)$"
n=2

Try it online!

B. Mehta

Posted 2014-02-23T02:43:24.113

Reputation: 763

0

W, 15 bytes

A proper quine, except it grows very oddly.

pp34CS+"pp34CS+

Iterations (You can see that the output gets between and after the source code... ):

pp34CS+pp34CS+"pp34CS+
pp34CS+pp34CS+pp34CS+pp34CS+"pp34CS+pp34CS+

user85052

Posted 2014-02-23T02:43:24.113

Reputation:

0

Batch

set d=time  
copy c:\>loop.bat /B loop%d%.bat  
call c:\>loop.bat

Daniel

Posted 2014-02-23T02:43:24.113

Reputation: 11

0

Javascript - 46

(function $(){console.log('('+$+'());$()')}())

Wolle Vanillebär Lutz

Posted 2014-02-23T02:43:24.113

Reputation: 256