Mercurial > repo
comparison bin/colorize @ 2335:16603a34c6d2
<oerjan> cat colorize.2 >bin/colorize
author | HackBot |
---|---|
date | Fri, 01 Mar 2013 03:29:05 +0000 |
parents | 2bcf4dad0ca9 |
children | 2deb4597f9c9 |
comparison
equal
deleted
inserted
replaced
2334:d938eb61bcc1 | 2335:16603a34c6d2 |
---|---|
1 #!/bin/sh | 1 #!/usr/bin/env python |
2 python -c "import random; w=raw_input(); p=list('x'*len(w)+'C'*int((341-len(w))/3+1)); random.shuffle(p); i=(c for c in w); print ''.join(i.next() if c=='x' else chr(3)+'%02d' % random.randrange(2,15) for c in ['C']+p)" | 2 import random |
3 import re | |
4 w=raw_input() | |
5 p=list('x'*len(w)+'C'*int((341-len(w))/3+1)) | |
6 random.shuffle(p) | |
7 i=(c for c in w) | |
8 print ''.join(i.next() if c=='x' else chr(3)+'%02d' % random.randrange(2,15) for c in ['C']+p) |