Mercurial > repo
annotate bin/rainwords @ 4155:1e4bcd213420
<oerjan> echo \'A catamorphism is when you recurse too greedily and too deep.\' >wisdom/catamorphism
author | HackBot |
---|---|
date | Tue, 10 Dec 2013 17:18:55 +0000 |
parents | 19cbf3f316f0 |
children |
rev | line source |
---|---|
2418 | 1 #!/usr/bin/python |
3946
19cbf3f316f0
<ais523_> sed --in-place \'s/13,6/6,13/\' bin/rainwords
HackBot
parents:
3914
diff
changeset
|
2 import random; w=[l.split() for l in open("/dev/stdin").read().split("\n")]; r=[4,7,8,9,2,6,13]; print "\n".join((lambda s: " ".join(chr(3) + "%02d"%r[(i+s)%len(r)] + l[i] for i in range(len(l))))(random.randrange(0, len(r))) for l in w) |