annotate bin/colorize @ 2338:a9994b1ad4ed

<oerjan> revert
author HackBot
date Fri, 01 Mar 2013 03:36:56 +0000
parents 2deb4597f9c9
children d693544a0ef5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2335
16603a34c6d2 <oerjan> cat colorize.2 >bin/colorize
HackBot
parents: 2253
diff changeset
1 #!/usr/bin/env python
16603a34c6d2 <oerjan> cat colorize.2 >bin/colorize
HackBot
parents: 2253
diff changeset
2 import random
16603a34c6d2 <oerjan> cat colorize.2 >bin/colorize
HackBot
parents: 2253
diff changeset
3 import re
16603a34c6d2 <oerjan> cat colorize.2 >bin/colorize
HackBot
parents: 2253
diff changeset
4 w=raw_input()
16603a34c6d2 <oerjan> cat colorize.2 >bin/colorize
HackBot
parents: 2253
diff changeset
5 p=list('x'*len(w)+'C'*int((341-len(w))/3+1))
16603a34c6d2 <oerjan> cat colorize.2 >bin/colorize
HackBot
parents: 2253
diff changeset
6 random.shuffle(p)
16603a34c6d2 <oerjan> cat colorize.2 >bin/colorize
HackBot
parents: 2253
diff changeset
7 i=(c for c in w)
16603a34c6d2 <oerjan> cat colorize.2 >bin/colorize
HackBot
parents: 2253
diff changeset
8 print ''.join(i.next() if c=='x' else chr(3)+'%02d' % random.randrange(2,15) for c in ['C']+p)