# HG changeset patch # User HackBot # Date 1362108545 0 # Node ID 16603a34c6d21a4e5c2636f76ff7fffa4457f4c4 # Parent d938eb61bcc158a1264394841a9da3e248f81f80 cat colorize.2 >bin/colorize diff -r d938eb61bcc1 -r 16603a34c6d2 bin/colorize --- a/bin/colorize Fri Mar 01 03:28:42 2013 +0000 +++ b/bin/colorize Fri Mar 01 03:29:05 2013 +0000 @@ -1,2 +1,8 @@ -#!/bin/sh -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)" +#!/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)