Skip to main content
use chr() instead of '%c'%
Source Link
Keith Randall
  • 21.1k
  • 2
  • 46
  • 106

Python, 9797 96 "characters"

Taking your use of the word "characters" liberally, here's some python that uses 16-bit unicode characters to encode 3 normal characters each. The program is a total of 9796 characters, 35 of which are the weirdest unicode characters I've ever seen.

for i in range(104):print'%c'%print chr((ord(u'ࠠᒃ⃦ⵉ��割廕��匓�เ᳅ⵉૹ�懬ࣅű傎ᱨ�⤰〷�弙劶��ⶍKᓇࡤ^A'[i/3])>>i%3*5&31)+97),

I'm not sure the unicode garbage will come though correctly, so here's a python program to generate the above python program:

#!/usr/bin/python                                                                                                                                                                 
import codecs
f=codecs.open('alpha.py','w','utf-8')
f.write('#!/usr/bin/python\n')
f.write('# coding=utf-8\n')
f.write('for i in range(104):print"%c"%print chr((ord(u\"')
S='''abcdefghijklmnopqrstuvwxyzqwertyuiopasdfghjklzxcvbnmpyfgcrlaoeuidhtnsqjkxbmwvzzyxwvutsrqponmlkjihgfedcbaa'''
for i in xrange(0,104,3):
 n=32*32*(ord(S[i+2])-97)+32*(ord(S[i+1])-97)+ord(S[i+0])-97
 f.write(u'%c'%n)
f.write('"[i/3])>>i%3*5&31)+97),\n')

Python, 97 "characters"

Taking your use of the word "characters" liberally, here's some python that uses 16-bit unicode characters to encode 3 normal characters. The program is a total of 97 characters, 35 of which are the weirdest unicode characters I've ever seen.

for i in range(104):print'%c'%((ord(u'ࠠᒃ⃦ⵉ��割廕��匓�เ᳅ⵉૹ�懬ࣅű傎ᱨ�⤰〷�弙劶��ⶍKᓇࡤ^A'[i/3])>>i%3*5&31)+97),

I'm not sure the unicode garbage will come though correctly, so here's a python program to generate the above python program:

#!/usr/bin/python                                                                                                                                                                 
import codecs
f=codecs.open('alpha.py','w','utf-8')
f.write('#!/usr/bin/python\n')
f.write('# coding=utf-8\n')
f.write('for i in range(104):print"%c"%((ord(u\"')
S='''abcdefghijklmnopqrstuvwxyzqwertyuiopasdfghjklzxcvbnmpyfgcrlaoeuidhtnsqjkxbmwvzzyxwvutsrqponmlkjihgfedcbaa'''
for i in xrange(0,104,3):
 n=32*32*(ord(S[i+2])-97)+32*(ord(S[i+1])-97)+ord(S[i+0])-97
 f.write(u'%c'%n)
f.write('"[i/3])>>i%3*5&31)+97),\n')

Python, 97 96 "characters"

Taking your use of the word "characters" liberally, here's some python that uses 16-bit unicode characters to encode 3 normal characters each. The program is a total of 96 characters, 35 of which are the weirdest unicode characters I've ever seen.

for i in range(104):print chr((ord(u'ࠠᒃ⃦ⵉ��割廕��匓�เ᳅ⵉૹ�懬ࣅű傎ᱨ�⤰〷�弙劶��ⶍKᓇࡤ^A'[i/3])>>i%3*5&31)+97),

I'm not sure the unicode garbage will come though correctly, so here's a python program to generate the above python program:

#!/usr/bin/python                                                                                                                                                                 
import codecs
f=codecs.open('alpha.py','w','utf-8')
f.write('#!/usr/bin/python\n')
f.write('# coding=utf-8\n')
f.write('for i in range(104):print chr((ord(u\"')
S='''abcdefghijklmnopqrstuvwxyzqwertyuiopasdfghjklzxcvbnmpyfgcrlaoeuidhtnsqjkxbmwvzzyxwvutsrqponmlkjihgfedcbaa'''
for i in xrange(0,104,3):
 n=32*32*(ord(S[i+2])-97)+32*(ord(S[i+1])-97)+ord(S[i+0])-97
 f.write(u'%c'%n)
f.write('"[i/3])>>i%3*5&31)+97),\n')
Source Link
Keith Randall
  • 21.1k
  • 2
  • 46
  • 106

Python, 97 "characters"

Taking your use of the word "characters" liberally, here's some python that uses 16-bit unicode characters to encode 3 normal characters. The program is a total of 97 characters, 35 of which are the weirdest unicode characters I've ever seen.

for i in range(104):print'%c'%((ord(u'ࠠᒃ⃦ⵉ��割廕��匓�เ᳅ⵉૹ�懬ࣅű傎ᱨ�⤰〷�弙劶��ⶍKᓇࡤ^A'[i/3])>>i%3*5&31)+97),

I'm not sure the unicode garbage will come though correctly, so here's a python program to generate the above python program:

#!/usr/bin/python                                                                                                                                                                 
import codecs
f=codecs.open('alpha.py','w','utf-8')
f.write('#!/usr/bin/python\n')
f.write('# coding=utf-8\n')
f.write('for i in range(104):print"%c"%((ord(u\"')
S='''abcdefghijklmnopqrstuvwxyzqwertyuiopasdfghjklzxcvbnmpyfgcrlaoeuidhtnsqjkxbmwvzzyxwvutsrqponmlkjihgfedcbaa'''
for i in xrange(0,104,3):
 n=32*32*(ord(S[i+2])-97)+32*(ord(S[i+1])-97)+ord(S[i+0])-97
 f.write(u'%c'%n)
f.write('"[i/3])>>i%3*5&31)+97),\n')