Python + Piet one-liners: 417 chars + 7391 7107 executing codels
This Python script produces a 7393 x 2 image; the rightmost 2x2 block of which is a "sentinel" which terminates the program; so I'm not counting those; and the second row is otherwise white. I can probably golf the piet code down further by using addition/subtraction/multiplication chains instead of the naive binary algorithm... but I don't want to give away a solution to a future puzzle.
I'm not going to post the image here, because of its ridiculous dimensions. If you want to see it, run the python code, and pipe the output to a .ppm file. Then, convert the .ppm to a .gif, and run the output at Rapapaing. (alternately, use a non-web Piet interpreter that groks .ppm)
A='P=lambda A:reduce(lambda(D,H,B),P:(D[P/3:]+D[:P/3],H[P%3*2:]+H[:P%3*2],B+"".join("%i "%H[(D[0]/P)%2]for P in[1,2,4])),map(" A ! @ B".find,A),([1,3,2,6,4,5],[0,192,192,255,0,255],"P3 %i 2 255 "%(len(A)+2)))[2]+"255 "*4+"0 0 "+"255 "*len(A)*3+"255 0 0 "*2;B=lambda D:["@!%s","@@!%s!"][D%2]%B(D/2)if 1<D else"";print P("".join("A%sB"%B(ord(D))for D in"A=%s;exec A[:-13]"%`A`)+" ");exec A[:-13]';exec A[:-13]
edit: golfed the piet a bit by reducing Hamming weight of variable names.
less golfed pre-quine:
This is a previous version, before I realized I could make it a one-liner. It's marginally easier to understand. The function P translates a special instruction set into Piet; and the function p takes an integer and produces a sequence of instructions to create that integer on the stack. I'm only using the instructions =,+,:,|
, so this could probably be made more efficient... but I kinda like having a fullblown Piet compiler (of sorts) in the source.
s="""def P(s):
l=len(s)+1;R="P3 %i 2 255 "%(l+2);C=[1,3,2,6,4,5];V=[0,192,192,255,0,255]
for x in map("=|^+-*/%~>.,:@$?#!".find,"="+s):
C=C[x//3:]+C[:x//3];V=V[x%3*2:]+V[:x%3*2]
for i in [1,2,4]:R+="%i "%V[(C[0]//i)%2]
return R+"255 "*4+"0 0 "+"255 "*l*3+"255 0 0 "*2
p=lambda x:[":+%s","::+%s+"][x%2]%p(x/2)if x/2 else""
print P("".join("|%s!"%k(ord(c))for c in "s="+`s`+";exec s[:-13]"))
exec s[:-13]"""
exec s[:-13]
Can language A = language B? – programmer5000 – 2017-05-22T19:01:07.833
1Since this is golf, can you clarify the scoring criteria? For example, is the final score the sum of the byte counts of P and Q? Or the minimum of the byte counts of P and Q? – b_jonas – 2018-03-29T20:06:49.127
9Btw, this should preclude cases where the sources match. For example
1
is a quine in several languages. So you could say its a J program that prints a Golfscript program that prints a...... and so on. – cthom06 – 2011-05-16T20:49:20.550you can adopt the rule of "Try to avoid or rather don't use 1 byte submissions like this one ,since it spoils all fun." from http://codegolf.stackexchange.com/questions/1393/code-golf-quine-challenge-i
– Ming-Tang – 2011-05-16T22:40:48.1302A Brainfuck + Befunge solution should be posted. – pyon – 2011-07-15T00:13:32.347