nkanaev / posts / A quine made with love

Here's a simple quine in Python 3:

import base64;exec(base64.b64decode("""aW1wb3J0IGJhc2U2NApoPSdpb
XBvcnQgYmFzZTY0O2V4ZWMoYmFzZTY0LmI2NGRlY29kZSgiIiInCnQ9JyIiIikpJ
wp4PSdpbXBvcnQgYmFzZTY0XG5oPSVyXG50PSVyXG54PSVyXG5mcj0lclxuZXI9J
XJcbmY9JXNcbmU9JXNcbnByaW50KGgrZihlKHglJShoLHQseCxmcixlcixmcixlc
ikpLDY0LWxlbihoKSkrdCknCmZyPSdsYW1iZGEgeCxzOmNocigxMCkuam9pbih4W
21heCgwLGktNjQpOmldIGZvciBpIGluIHJhbmdlKHMsbGVuKHgpKzY0LDY0KSknC
mVyPSdsYW1iZGEgeDpiYXNlNjQuYjY0ZW5jb2RlKGJ5dGVzKHgsInV0ZjgiKSkuZ
GVjb2RlKCknCmY9bGFtYmRhIHgsczpjaHIoMTApLmpvaW4oeFttYXgoMCxpLTY0K
TppXSBmb3IgaSBpbiByYW5nZShzLGxlbih4KSs2NCw2NCkpCmU9bGFtYmRhIHg6Y
mFzZTY0LmI2NGVuY29kZShieXRlcyh4LCJ1dGY4IikpLmRlY29kZSgpCnByaW50K
GgrZihlKHglKGgsdCx4LGZyLGVyLGZyLGVyKSksNjQtbGVuKGgpKSt0KQ=="""))

Just a "brick" that relies on base64, which coincidentally has 64 characters per line.

There was something missing in it. So I made another one, this time with love:

import base64,re;exec(base64.b64decode(re.sub(chr(27)+"...","","""aW1wb3J0IGJhc
2U2NCxmdW5jdG9vbHMgYXMgRgpoPSdpbXBvcnQgYmFzZTY0LHJlO2V4ZWMoYmFzZTY0LmI2NGRlY29k
ZShyZS5zdWIoY2hyKDI3KSsiLi4uIiwiIiwiIiInCnQ9JyIiIikpKSNudXJqYW4nCng9J2ltcG9ydCB
iYXNlNjQsZnVuY3Rvb2xzIGFzIEZcbmg9JXJcbnQ9JXJcbng9JXJcbmZyPSVyXG5lcj0lclxuczE9JX
JcbnMyPSV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ixPLEwsZnIsZXIsczEs
czIsTyxMKSksNzktbGVuKGgpKSt0CnM9WyhyLGMsYysxKSBmb3Igcix5IGluIGVudW1lcmF0ZShyYW5
nZSgxNCwtMTUsLTEpKSBmb3IgYyx4IGluIGVudW1lcmF0ZShyYW5nZSgrNzkvLzIsLTc5Ly8yLC0xKS
lpZih4KngreSp5KjQtMjAwKSoqMzx4KngqeSoqMyozMDBdCnM9Ri5yZWR1Y2UobGFtYmRhIHMscDpzW
zotMV0rWyhwWzBdLHNbLTFdWzFdLHBbMl0pXWlmIHMgYW5kIHNbLTFdWzJdPT1wWzFdIGVsc2Ugcytb
cF0sIHMsIFtdKQpvbz1vLnNwbGl0bGluZXMoKTtJPWxhbWJkYSBvLHIscyxlOm9bOnJdK1tvW3JdWzp
zXSsiG1s1bSIrb1tyXVtzOmVdKyIbWzBtIitvW3JdW2U6XV0rb1tyKzE6XQpmb3IgcixzLGUgaW4gcm
V2ZXJzZWQocyk6b289SShvbyxyLHMsZSkKcHJpbnQoY2hyKDEwKS5qb2luKG9vKSk=""")))#nurjan

It isn't a quine per se, but becomes one when the message is revealed:

# save the content above as quine.py
$ python3 --version
3.8.11
$ python3 quine.py > quine2.py
$ python3 quine2.py | diff - quine2.py
$ cat quine2.py