Welcome, guest | Sign In | My Account | Store | Cart

A Quine is a program that, when run, prints its own source code (without resorting to easy solutions like reading its code from the filesystem). The rot13 encoding maps every letter 13 places forwards in the alphabet (wrapping around the end and preserving case). Just for fun, I wrote a quine in the rot13 encoding.

Python, 5 lines
1
2
3
4
5
# -*- encoding: rot13 -*-
# rot13 quine!
qngn = "print '# -*- encoding: rot13 -*-\\n# rot13 quine!\\nqngn = '+`data`.encode('ebg13')\aprint data"
cevag '# -*- rapbqvat: ebg13 -*-\a# ebg13 dhvar!\adata = '+`qngn`.rapbqr('rot13')
cevag qngn

1 comment

david.gaarenstroom 12 years, 7 months ago  # | flag

I don't think this snippet is very useful...

But it reminds me of a nice quote "I know the rot13 encryption isn't very strong, so I ran it twice..."

Created by Daniel Lepage on Wed, 22 Apr 2009 (MIT)
Python recipes (4591)
Daniel Lepage's recipes (1)

Required Modules

  • (none specified)

Other Information and Tasks