# HG changeset patch # User HackBot # Date 1362108522 0 # Node ID d938eb61bcc158a1264394841a9da3e248f81f80 # Parent dcbc60550ce6346b756797e8b16f821cca4b75fa fetch http://oerjan.nvg.org/colorize diff -r dcbc60550ce6 -r d938eb61bcc1 colorize.2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/colorize.2 Fri Mar 01 03:28:42 2013 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/env python +import random +import re +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)