Mercurial > repo
comparison bin/colorize @ 2338:a9994b1ad4ed
<oerjan> revert
author | HackBot |
---|---|
date | Fri, 01 Mar 2013 03:36:56 +0000 |
parents | 2deb4597f9c9 |
children | d693544a0ef5 |
comparison
equal
deleted
inserted
replaced
2337:2deb4597f9c9 | 2338:a9994b1ad4ed |
---|---|
2 import random | 2 import random |
3 import re | 3 import re |
4 w=raw_input() | 4 w=raw_input() |
5 p=list('x'*len(w)+'C'*int((341-len(w))/3+1)) | 5 p=list('x'*len(w)+'C'*int((341-len(w))/3+1)) |
6 random.shuffle(p) | 6 random.shuffle(p) |
7 p=list(re.sub(C+,C,.join(p))) | |
8 i=(c for c in w) | 7 i=(c for c in w) |
9 print ''.join(i.next() if c=='x' else chr(3)+'%02d' % random.randrange(2,15) for c in ['C']+p) | 8 print ''.join(i.next() if c=='x' else chr(3)+'%02d' % random.randrange(2,15) for c in ['C']+p) |