Skip to main content
minor changes
Source Link
M L
  • 3.3k
  • 1
  • 19
  • 19

Julia, 66 chars

x="print(\"x=\$(repr(x))\\n\$x;\"^2);";print";print("x=$(repr(x))\n$x"^2\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="print(\"x=\$(repr(x))\\n\$x;\"^2);""
print("x=$(repr(x))\n$x;"^2);;x="print;x="print(\"x=\$(repr(x))\\n\$x;\"^2);""
print("x=$(repr(x))\n$x;"^2);;x="print;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="print(\"x=\$(repr(x))\\n\$x;\"^2);""
print("x=$(repr(x))\n$x;"^2);;x="print;x="print(\"x=\$(repr(x))\\n\$x;\"^2);""
print("x=$(repr(x))\n$x;"^2);;x="print;x="print(\"x=\$(repr(x))\\n\$x;\"^2);""
print("x=$(repr(x))\n$x;"^2);;x="print;x="print(\"x=\$(repr(x))\\n\$x;\"^2);""
print("x=$(repr(x))\n$x;"^2);;x="print;x="print(\"x=\$(repr(x))\\n\$x;\"^2);""
print("x=$(repr(x))\n$x;"^2);;x="print;x="print(\"x=\$(repr(x))\\n\$x;\"^2);""
print("x=$(repr(x))\n$x;"^2);;x="print;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.

Julia, 66 chars

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

Output:

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:

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:

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 code that produces larger output again.

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.

added 883 characters in body
Source Link
M L
  • 3.3k
  • 1
  • 19
  • 19

Julia, 566 chars

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

Output:

"....."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);

Hitting just enter inResult of executing the REPL gives you seven characters, but I guess that doesn’t count. ;)result:

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);;

(There is one space after the ">") next result:

julia> 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);;

The task isn’t a program printing its own source code, plus at least one character more. My interpretationI hope this is that it just hasaccording to the rules.

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

Julia, 5 chars

"."^5

Output:

"....."

Hitting just enter in the REPL gives you seven characters, but I guess that doesn’t count. ;)

(There is one space after the ">")

julia> 

The task isn’t a program printing its own source code, plus at least one character more. My interpretation is that it just has to output valid source code.

Julia, 66 chars

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

Output:

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:

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:

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 code that produces larger output again.

Source Link
M L
  • 3.3k
  • 1
  • 19
  • 19

Julia, 5 chars

"."^5

Output:

"....."

Hitting just enter in the REPL gives you seven characters, but I guess that doesn’t count. ;)

(There is one space after the ">")

julia> 

The task isn’t a program printing its own source code, plus at least one character more. My interpretation is that it just has to output valid source code.