12
\$\begingroup\$

Your challenge is to construct a proper quine using as few distinct characters as possible.

Scoring

Your score is equal to the number of distinct characters in your code, aiming to minimise this. Standard quine rules apply.

\$\endgroup\$
2
  • 5
    \$\begingroup\$ unary quine wins this lol \$\endgroup\$
    – hyper-neutrino
    Jun 19, 2021 at 12:55
  • 2
    \$\begingroup\$ Runner up: Ørjan Johansen's /// quine using only / and \ \$\endgroup\$
    – Jo King
    Jun 19, 2021 at 14:54

14 Answers 14

11
\$\begingroup\$

Python 3, 9 distinct characters, 15341 bytes

exec('%c'%(+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)+'%c'%(+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)+'%c'%(+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)+'%c'%(+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)+'%c'%(+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)+'%c'%(+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)+'%c'%(+1+1+1+1+1+1+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1+1+1+1+1+1+1+1+1+1+1+1)+'%c'%(+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1)+'%c'%(+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1+1))

Try it online!

This encodes each character as a series of +1s and then sums them all together before executing the final encoded program:

A="""print(end='exec('+'+'.join("'%%c'%%("+'+1'*ord(B)+")"for B in'A=""'+'"'+%r+'"'+'"";exec(A%%A)')+")")""";exec(A%A)

Try it online!

\$\endgroup\$
7
  • \$\begingroup\$ Impressive! Is the trailing newline needed? \$\endgroup\$
    – user100690
    Jun 19, 2021 at 18:49
  • \$\begingroup\$ @Recursive Co. I guess it's to account for the extra newline printed, but print(end=...) or print(...,end='') should fix that? \$\endgroup\$ Jun 19, 2021 at 20:05
  • 1
    \$\begingroup\$ I think that since 7 characters are enough for universality, that should allow making a quine. \$\endgroup\$
    – xnor
    Jun 19, 2021 at 22:00
  • \$\begingroup\$ @dingledooper Ah I completely forgot about the newline. Yes I'll remove that soon \$\endgroup\$
    – Jo King
    Jun 20, 2021 at 1:00
  • 1
    \$\begingroup\$ For the trailing newline, if you don't mind about errors, you can replace print(end=...) by input(...) wich prints to stdout without the trailing newline (the only thing is that it will throw an EOFError). It also saves 770 bytes \$\endgroup\$
    – Jakque
    Jun 20, 2021 at 23:07
9
\$\begingroup\$

><>, 3 distinct characters, 1432 bytes

111-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1--11-11-p111-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1--111-p111-1-1-1-1-1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-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1--11-1p111-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1-1--11p

Try it online!

This uses the characters 1-p to put this code at the start of the program:

"/
o<
:/r~:

This quotes the whole program, accounts for the characters that were overwritten, and then outputs the program itself.

\$\endgroup\$
6
\$\begingroup\$

Haskell, Score 13, 523 bytes

p=putStr;main=a>>mmm>>a>>mmm>>mmmm>>mmmmm>>mmm>>mm>>mmm>>mmmm>>mm>>mmmmm>>mmm>>mmmmmm>>mmm>>mmm>>mmmm>>mm>>mm>>mmmmm>>mmm>>mmmm>>mmm>>mmmm>>mm>>mm>>mm>>mmmmm>>mmm>>mmmmm>>mmm>>mmmm>>mm>>mm>>mm>>mm>>mmmmm>>mmm>>mmmmmm>>mmmmmm>>mmm;a=p"p=putStr;main=a>>mmm>>a>>mmm>>mmmm>>mmmmm>>mmm>>mm>>mmm>>mmmm>>mm>>mmmmm>>mmm>>mmmmmm>>mmm>>mmm>>mmmm>>mm>>mm>>mmmmm>>mmm>>mmmm>>mmm>>mmmm>>mm>>mm>>mm>>mmmmm>>mmm>>mmmmm>>mmm>>mmmm>>mm>>mm>>mm>>mm>>mmmmm>>mmm>>mmmmmm>>mmmmmm>>mmm;a=p";mm=p"m";mmm=p"\"";mmmm=p";m";mmmmm=p"m=p";mmmmmm=p"\\"

Try it online!

The used characters are:

p=utSr;main>"\
\$\endgroup\$
1
  • 2
    \$\begingroup\$ mmmmmmmmm, yum! \$\endgroup\$
    – emanresu A
    Jun 20, 2021 at 8:14
4
\$\begingroup\$

Charcoal, 31 bytes, 4 distinct characters

≔´θ´´´≔´´´´´⪫´θ´´´´´θθ´≔´´⪫θ´´θ

Try it online! Explanation: I started with the standard Charcoal quine from Golf you a quine for great good! (which uses six distinct characters) and adapted it to try to remove the , and ι characters, which I was able to do at the cost of having to use the character instead. I was then amused to discover that in fact the final quine was the same length as the original quine (less the trailing newline, which was needed for a true quine in the then version of Charcoal that used instead of ).

\$\endgroup\$
2
  • \$\begingroup\$ Nice - we're tied for length (not that that matters, but still). \$\endgroup\$ Jun 19, 2021 at 12:00
  • \$\begingroup\$ might be worth linking the answer directly for the standard quine \$\endgroup\$
    – ASCII-only
    Jun 21, 2021 at 7:25
4
\$\begingroup\$

Ruby, 31 bytes, score: 8 distinct bytes

$;="$;=%p;$><<$;%%$;";$><<$;%$;

Try it online!

\$\endgroup\$
4
\$\begingroup\$

Jelly, 3 bytes, 2 distinct bytes

”ṘṘ

Try it online!

How it works

This is the standard Jelly quine, nothing too interesting

”ṘṘ - Main link. Takes no arguments
”Ṙ  - Yield the character "Ṙ"
  Ṙ - Convert to a Jelly representation ("Ṙ" -> ”Ṙ) and print
    - Implicitly output the character "Ṙ"
\$\endgroup\$
1
  • 2
    \$\begingroup\$ maybe we should have a thread for quines from the main question which are also optimal here. \$\endgroup\$
    – Razetime
    Jun 20, 2021 at 9:31
3
\$\begingroup\$

Python 3, 11 distinct bytes

p='p=%r;print(p%%p)';print(p%p)

Try it online!

Nice. Uses p and r as variables because print is necessary, so why not just use the characters from there? 31 bytes in length if that's a tiebreaker.

I don't see this being improved on, given TC Python 3 is already 7 8 characters.

Python 2, 10 distinct bytes

p='p=%r;print p%%p';print p%p

Try it online!

What I do see, however, is that Recursive Co. has gotten a 10 byte answer, which, again, is 3 from optimal. Go upvote their answers as well!

\$\endgroup\$
7
  • \$\begingroup\$ Uh, wouldn't that mean 7 bytes is a lower bound then? \$\endgroup\$
    – Jo King
    Jun 19, 2021 at 11:48
  • \$\begingroup\$ Yes. Yes it does. \$\endgroup\$ Jun 19, 2021 at 11:49
  • \$\begingroup\$ so, you mean it can be improved on right? also, python 3 is TC in ~8~ 9 chars, python 2 is 7 \$\endgroup\$
    – Jo King
    Jun 19, 2021 at 11:55
  • \$\begingroup\$ It CAN, but realistically, it most likely won't be given I'm 3 from optimal \$\endgroup\$ Jun 19, 2021 at 11:59
  • \$\begingroup\$ Python 2: uses spaces instead of () \$\endgroup\$
    – user100690
    Jun 19, 2021 at 12:00
2
\$\begingroup\$

Ruby, 25 bytes 8 distinct bytes

p="p=%p;$><<p%%p";$><<p%p

Try it online!

Thanks to Jo King for -1 distinct byte

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Pretty trivial to get to 8 bytes. Pity you can't reuse p as the output function though \$\endgroup\$
    – Jo King
    Jun 19, 2021 at 13:54
  • \$\begingroup\$ @JoKing dammit, just as I posted my score 8 answer! \$\endgroup\$
    – pxeger
    Jun 19, 2021 at 13:56
  • \$\begingroup\$ @JoKing, afaik, you actually can use p as the output function, even after defining it as a variable. e.g: tio.run/##KypNqvz/v0DBVsGUq0Ch4P9/AA i dont think its relevant here though, as p would output the string with quotes \$\endgroup\$
    – user100752
    Jun 19, 2021 at 14:05
  • \$\begingroup\$ i meant that it can't be used in a quine context which would have been neat \$\endgroup\$
    – Jo King
    Jun 19, 2021 at 14:06
  • \$\begingroup\$ Ah i get what you mean. Thanks for the -1 bytes anyways! \$\endgroup\$
    – user100752
    Jun 19, 2021 at 14:06
2
\$\begingroup\$

JavaScript console (9 8 7 distinct characters, 21 22 24 bytes)

($=$=>'($='+$+')($)')($)

Thanks to JoKing, again for -1 byte!

Older versions

($=_=>`($=`+$+`)()`)() // 8 distinct characters
($=_=>`($=${$})()`)() // 9 distinct characters
\$\endgroup\$
4
  • 2
    \$\begingroup\$ You can also shorten this to 7 bytes ($=$=>'($='+$+')($)')($) (lol) \$\endgroup\$
    – Jo King
    Jun 19, 2021 at 14:10
  • \$\begingroup\$ Thanks @JoKing! i got the 8 distinct character version seconds before you posted. \$\endgroup\$
    – user100752
    Jun 19, 2021 at 14:13
  • \$\begingroup\$ Is this a valid 6 byte? $=>`${$}``$` \$\endgroup\$
    – James
    Jun 19, 2021 at 16:14
  • \$\begingroup\$ @James No, that doesn't follow the proper quine rules that one part of the program should encode another. It's basically equivalent to $=>$ \$\endgroup\$
    – Jo King
    Jun 19, 2021 at 16:20
2
\$\begingroup\$

Klein, score 6, 71 bytes

<22+2+2+2+2+2+2+2+2+2+2+2+2+2+2+2+@+2+2+2+2+2+2+2+2+2+2+2+2+2+2+2+22<"

Try it online!

Uses the characters <2+@" and newline. This uses " to push all the rest of the program backwards. However since this portion of the program is a palindrome, there is no need to put it in the correct order. All we have to do is add " onto the end. This is done by adding a whole bunch of 2s up to 34.

\$\endgroup\$
2
\$\begingroup\$

C (gcc), score 21, 64 bytes

main(s){printf(s="main(s){printf(s=%c%s%c,34,s,34);}",34,s,34);}

Try it online!

Standard C quine, except not using the %1$c since that's extra chars.

Breakdown

  • main(,){";} (11) are probably required
  • printf (+5=16) is required for most standard quines
  • %cs (+3=19) from the format string
  • 34 (+2=21), the ASCII code for the double quote. I don't believe hexadecimal or octal will be better here
\$\endgroup\$
2
\$\begingroup\$

C (gcc) for Linux x86_64, score 13, 8241 7604 bytes

main[]={+1111+1111+1111+1111+1111+111+111+11+11+11+11+11+11+11+1+1+1+1+1+1+1+1+1+1,+1111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+111111+11111+11111+11111+11111+11111+11111+11111+11111+11111+1111+1111+1111+111+111+111+11+11+1+1,+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+11111+11111+1111+1111+1111+1111+1111+111+111+111+111+111+11+11+11+11+11+11+11+11+11+1+1,+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+1111111+1111111+111111+111111+111111+111111+11111+11111+1111+111+111+111+111+111+111+111+11+11,+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+1111111+1111111+111111+111111+111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+11111+11111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+111+111+1,+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+1111111+1111111+111111+111111+111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+11111+11111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+111+111+1,+1111111111+111111111+111111111+111111111+111111111+11111111+11111111+1111111+1111111+111111+111111+111111+111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+11111+1111+111+111+11+11+11+11+11+11+11+11+1+1+1,+1111111111+1111111111+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+11111+11111+11111+11111+1111+1111+1111+111+111+111+111+111+111+111+11+1+1+1+1+1,+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+1111111+1111+111+11+11+11+11+11+1+1+1+1+1+1+1+1+1,+111111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+11111+11111+11111+11111+11111+11111+1111+1111+1111+1111+1111+1111+1111+1111+111+111+111+111+11+11+11+11+1+1+1+1+1+1+1,+1111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+11111+1111+1111+11+11+11+11+1+1+1+1+1+1+1+1+1+1,+1111111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+111111+111111+111111+11111+11111+11111+11111+1111+1111+111+111,+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+11111+1111+1111+1111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+111+111+111+1+1+1+1+1+1,+1111111111+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+111111+1111+1111+1111+1111+1111+111+111+111+111+111+111+111+111+1+1+1+1+1+1,+1111111111,+1111111111+111111111+111111111+111111111+111111111+11111111+11111111+1111111+1111111+1111111+111111+11111+11111+11111+11111+11111+11111+11111+11111+1111+1111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+111+111+11+11+11+1+1+1,+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+111111+11111+11111+11111+11111+1111+1111+111+111+111+111+111+11+11+11+11+1+1,+1111111111+1111111111+1111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+111111+111111+111111+111111+111111+111111+111111+111111+11111+1111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+111+111+111+11+11+11+11+1+1+1+1+1+1,+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+111111+111111+111111+111111+111111+111111+11111+1111+1111+1111+1111+1111+1111+1111+111+111+111+11+11+11+11+1+1+1,+1111111111+1111111111+1111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+111111+1111+1111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+1,+1111111111+1111111111+1111111111+111111111+111111111+11111111+11111111+1111111+1111111+11111+11111+11111+11111+1111+1111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+111+1+1,+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+111111+111111+111111+111111+1111+1111+111+111+111+111+111+11+11+11+11+11+11+1+1+1+1+1,+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+111111+111111+111111+111111+111111+111111+11111+11111+1111+1111+1111+1111+1111+1111+111+111+111+111+11+11+11+11+11+11+11+11+1+1+1,+1111111111+1111111111+1111111111+111111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+1111+1111+1111+111+11+11+11+11+11+1+1+1+1+1,+1111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+111111+1111+1111+1111+1111+1111+1111+111+111+111+11+11+1,+1111111111+1111111111+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+111111+111111+111111+111111+111111+111111+11111+1111+1111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+111+111+111+111+11+11+11+11+11+11+11+1+1+1+1+1+1,+1111111111+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+111111+111111+111111+11111+11111+11111+11111+1111+1111+1111+111+111+111+111+111+111+111+111+11+11+11+11+11+11+1+1+1,+1111111111+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+1111111+1111111+1111111+111111+111111+111111+111111+111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+11111+11111+1111+1111+1111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+111+111+111+111+11+1+1+1+1,+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+11111111+1111111+1111111+111111+111111+111111+11111+11111+1111+1111+1111+1111+111+11+11+11+11+11+1+1+1+1,+11111111+11111111+11111111+11111111+11111111+1111111+111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+1111+1111+1111+111+1+1,+1111111111+1111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+111111111+11111111+11111111+11111111+11111111+1111111+1111111+1111111+1111111+111111+111111+111111+111111+111111+111111+11111+11111+11111+11111+11111+11111+11111+11111+11111+1111+1111+1111+1111+1111+1111+1111+1111+1111+111+111+111+111+111+111+111+111+11+11+11+11+11+11+1+1+1,1};

Try it online!

This uses the characters aimn[]={}+1,;

Bootstrap program:

.text
.section .text.startup,"ax",@progbits
.globl main
.type main, @function
main:
.cfi_startproc
call poprbp
.ascii "main[]={,+1111111111};"
poprbp:
pop %rsi
lea -5(%rsi),%rbp
lea 119(%rsi),%r8
push %rdi
pop %rax
push $8
pop %rdx
syscall
add $9, %rsi
push:
mov 0(%rbp),%r12d
push $11
pop %r13
mov $1111111111,%ebx
push $10
pop %r14
cmp:
cmp %r12d, %ebx
jbe movslq
xchg %ebx, %eax
xor %edx, %edx
dec %r13d
div %r14d
xchg %eax, %ebx
jmp cmp
movslq:
movslq %r13d, %rdx
ones:
push %rdi
pop %rax
syscall
sub %ebx,%r12d
jne cmp
comma:
dec %rsi
push %rdi
pop %rax
push %rdi
pop %rdx
syscall
inc %rsi
add $4, %rbp
cmp %r8, %rbp
jne push
theend:
add $10, %rsi
push $3
pop %rdx
syscall
ret
.cfi_endproc
.size main, .-main

Try it online!

This was based on the following C program.

#include<unistd.h>
main(){
  write(1,"main[]={",8);
  int i = 0;
  do {
    unsigned int x = 1111111111;
    unsigned int y = ((unsigned int*)main)[i];
    do {
      while( y<x ) {
        x/=10;
      } 
      printf("+%d",x);
    }
    while(y-=x);
    write(1,",",1);
  } while ( i++<10 ); 
  write(1,"1};",3);
}

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Perl 5, 18 distinct bytes

$_=q(print"\$_=q($_);eval;");eval;

Try it online!

This is a classic Perl quine. I have no idea how Perl works, but this is tested on TIO. Feel free to tell me how to improve this. 34 bytes if that matters.

\$\endgroup\$
1
\$\begingroup\$

Vyxal, 2 distinct bytes, 4 bytes

`I`I

Try it Online!

classic vyxal quine

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.