# HG changeset patch # User HackBot # Date 1363711177 0 # Node ID 016c73d5f846bc59f8784b6e9b4507d89cba7ea1 # Parent 627747a19b072241df4671a2105f67e6139b63fe mv bin/colorize bin/colorise diff -r 627747a19b07 -r 016c73d5f846 bin/colorise --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/colorise Tue Mar 19 16:39:37 2013 +0000 @@ -0,0 +1,9 @@ +#!/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) +p=list(re.sub('C+','C',''.join(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) diff -r 627747a19b07 -r 016c73d5f846 bin/colorize --- a/bin/colorize Tue Mar 19 12:56:58 2013 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -#!/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) -p=list(re.sub('C+','C',''.join(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)