# HG changeset patch # User HackBot # Date 1363711295 0 # Node ID 646619b8193e5a47bd436de496e165fe365e5167 # Parent a4b4bdc1179e724d8c8bf48abb812a96a2739130 for f in bin/colorise bin/colourize bin/colourise; do ln bin/colorize $f; done diff -r a4b4bdc1179e -r 646619b8193e bin/colorise --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/colorise Tue Mar 19 16:41:35 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 a4b4bdc1179e -r 646619b8193e bin/colourise --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/colourise Tue Mar 19 16:41:35 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 a4b4bdc1179e -r 646619b8193e bin/colourize --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/colourize Tue Mar 19 16:41:35 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)