g | x | w | all
Bytes Lang Time Link
nanUnary250509T193206ZJOrE
299In Squeak 4.x Smalltalk140109T005946Zaka.nice
019GTB140108T003253ZTimtech
220TCL140107T204845Zphilipp
643PHP140107T202637ZSammitch

Unary, 10^354 bytes

This code is so big as cannot fit in universe.

The number of zeros in this code:

176,960,425,609,039,356,189,367,013,867,307,597,680,931,630,750,984,369,544,503,742,943,784,363,779,301,473,644,287,176,854,665,117,510,539,101,272,870,963,495,587,284,329,829,092,795,067,336,207,895,604,077,402,040,761,611,376,899,648,587,264,491,481,035,949,333,668,403,141,421,396,464,839,485,888,458,450,038,930,297,331,386,592,032,208,898,841,107,227,073,421,652,136,579,626,690,871,410,035,366,883,474,662,067,920,204,271,328,193,254,384,297,677,002,504,105,698,574

Orginal Brainfuck Code

->++>+++>+>+>+++>>>>>>>>>>>>>>>>>>>>+>+>++>+++>++>>+++>+>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>+>+>>+++>>+++>>>>>+++>+>>>>>>>>>++>+++>+++>+>>+++>>>+++>+>++>+++>>>+>+>++>+++>+>+>>+++>>>>>>>+>+>>>+>+>++>+++>+++>+>>+++>>>+++>+>++>+++>++>>+>+>++>+++>+>+>>+++>>>>>+++>+>>>>>++>+++>+++>+>>+++>>>+++>+>+++>+>>+++>>+++>>++[[>>+[>]++>++[<]<-]>+[>]<+<+++[<]<+]>+[>]++++>++[[<++++++++++++++++>-]<+++++++++.<]

It may be the shortest brainfuck quine possible. This unary code based on it.

In Squeak 4.x Smalltalk, it's not golfed, but there is a 299 chars version below

Compile this method in Object:

quine
[| value morph |
value := (((self negated raisedTo: self - 1) / 15) exp exp - 1) reciprocal significand rounded reciprocal.
morph := ToolSet inspect: value.
[(Delay forSeconds: value reciprocal * 5) wait.
morph delete] fork.
World displayWorld.
(Delay forSeconds: 1) wait]
    on: Error
    do: [:exc | 
        FileDirectory default deleteFileNamed: 'quine'.
        ^self].
(FileStream forceNewFileNamed: 'quine') nextPutAll: thisContext method getSource; close.
^self class newCompiler
    evaluate: ((FileStream oldFileNamed: 'quine') contentsOfEntireFile lines allButFirst reduce: [:a :b | a , b])
    for: self + 1

Then evaluate '1 quine' where you want.

Each evaluation differs, because it is evaluated with incremented receiver. ( evaluate: ... for: self+1 )

The awfull expression computing the value is different for 3 (lead to a Fraction 1/2 instead of Integer 1) and for 5 (lead to ZeroDivide).

The file is deleted when the exception is caught and 5 is returned.

Otherwise, an inspector is opened on the value, the display is refreshed, the process is paused during 1 second before evaluating next quine.

A process for closing opened inspectors after a longer pause is forked.

The source of quine is retrieved via the current context of execution (thisContext method getSource), written, then re-evaluated without the first line (the name of the method). So the second and successive evaluation do not evaluate #quine, but an anonymous (#Doit) method sharing exactly the same contents.

Based on same principles, this less funny example will print 00100 in Transcript then stop when evaluating 1 quine, but it avoids explicit 3 and 5 in source:

quine|v|v:=self highBit-self lowBit.Transcript show:(1bitAnd:v).(2bitAnd:v)=0or:[^FileDirectory default deleteFileNamed:'q'].(FileStream forceNewFileNamed:'q')nextPutAll:thisContext method getSource;close.^Compiler evaluate:((FileStream oldFileNamed:'q')contentsOfEntireFile allButFirst:5)for:self+1

GTB, 19

X+1→X@X<15$@X=13:1&

Explanation

X starts by default at 10, so we increment X once. Then, if X<15 check if X=13. If X=13, change the code. Then dump it all to memory.

TCL 220

proc a b {
if {"$b"=="bb"} {
rename puts w
rename p puts
set b \;exit
}
puts [set q [open [incr ::i] w]] "proc a b \{[info body a]\};a b"
catch {rename puts p}
proc puts {n m} "p \$n \${m}$b"
close $q
source $::i
};a b

The code generates files 1, 2, 3 and 4. The variation is only present in 2, the others are equivalent to the original.

PHP 643

<?
$c=1;
$o="<?\n\$c=".($c+1).";\n";
$m="quine";
$s=array(
'$o="<?\n\$c=".($c+1).";\n";',
'$m="quine";',
'$s=array(',
');',
'if($c==3)$s[1]="\$m=\"bip\";";',
'for($i=0;$i<3;$i++)$o.=$s[$i]."\n";',
'for($i=0;$i<count($s);$i++)$o.=chr(39).$s[$i].chr(39).",\n";',
'for($i=3;$i<count($s);$i++)$o.=$s[$i]."\n";',
'echo $m."\n";',
'if($c<5){file_put_contents("q$c.php", $o);echo `php q$c.php`;}',
);
if($c==3)$s[1]="\$m=\"bip\";";
for($i=0;$i<3;$i++)$o.=$s[$i]."\n";
for($i=0;$i<count($s);$i++)$o.=chr(39).$s[$i].chr(39).",\n";
for($i=3;$i<count($s);$i++)$o.=$s[$i]."\n";
echo $m."\n";
if($c<5){file_put_contents("q$c.php", $o);echo `php q$c.php`;}

Output:

quine
quine
quine
bip
bip

The variation in the code is produced in the 3rd iteration and is then only noticeable in the echoes of the 4th and 5th iterations.