annotate bin/zalgo @ 12267:7e5beba54694
draft
<b_jonas> slashlearn aoc//Advent of Code (AoC) is a series of programming puzzles that some regulars enjoy, found at "https://adventofcode.com/2019/about".
author |
HackEso <hackeso@esolangs.org> |
date |
Mon, 16 Dec 2019 22:53:41 +0000 |
parents |
c989a1669243 |
children |
|
rev |
line source |
9075
|
1 #!/hackenv/bin/shebang_args_or_input python
|
|
2 import codecs,sys,random
|
|
3 stdin=codecs.getreader("utf-8")(sys.stdin)
|
|
4 stdout=codecs.getwriter("utf-8")(sys.stdout)
|
|
5 x=[unichr(0x300+i) for i in range(0,112)+[393,2887]]
|
|
6 def z(n,c):
|
|
7 if c in ["\n"]+x:
|
|
8 n=0
|
|
9 return u"".join(x[random.randrange(0,len(x))] for i in range(n))
|
|
10 stdout.write(u"".join(c+z(2,c) for c in stdin.read()) + u"\n")
|