19
1
Your task is simple: Write a program (or function) that takes no input and outputs something like this:
## *name*, *length* bytes
*code*
Where *name*
is the name of the language you are using, *length*
is the number of bytes in your code, and *code*
is your program's source code. If *code*
contains multiple lines, it have four spaces before each line.
Here's a 124-byte example implementation in Python 3:
s = "## Python 3, 124 bytes{2} s = {1}{0}{1}{2}print(s.format(s,chr(34),chr(10)))"
print(s.format(s,chr(34),chr(10)))
The output is:
## Python 3, 124 bytes
s = "## Python 3, 124 bytes{2} s = {1}{0}{1}{2}print(s.format(s,chr(34),chr(10)))"
print(s.format(s,chr(34),chr(10)))
Which in Markdown is:
Python 3, 124 bytes
s = "## Python 3, 124 bytes{2} s = {1}{0}{1}{2}print(s.format(s,chr(34),chr(10)))" print(s.format(s,chr(34),chr(10)))
This is code-golf, so the shortest answer (in bytes) wins.
3I'm pretty sure this is a dup, but can't find the old one... – Dada – 2016-11-06T22:14:30.160
Related – Adnan – 2016-11-06T22:20:17.213
1I'd say this is different enough from that one because it's generating one for itself. The idea is similar, but you need to write a quine for this one. – Esolanging Fruit – 2016-11-06T22:23:27.170
Should we assume standard quine rules (e.g. no opening your own code and reading it)? – Gabriel Benamy – 2016-11-06T22:32:45.690
@GabrielBenamy Yes. – Esolanging Fruit – 2016-11-06T22:49:32.333
Strange, I had this idea like two days ago... – Oliver Ni – 2016-11-07T00:08:43.270
This is definitely a duplicate as I remember: Pyke, 0 bytes. Click the copy answer button on the website – Blue – 2016-11-07T00:10:28.250
@muddyfish I searched that on Google. Was it this one?
– Esolanging Fruit – 2016-11-07T01:20:04.617@muddyfish this has been posted in TNB as a chat mini challenge a couple times, it could have been that. – Rɪᴋᴇʀ – 2016-11-07T02:56:32.453