Source Highlighting Test
by kbob
We’re supposed to have source code highlighting. Let’s see how well it works.
Check out that oldschool =&
operator.
Here’s another example with line numbers.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
from functools import reduce
from itertools import count, cycle, islice, repeat
def fizzbuzz(*args):
class d(int): __add__ = lambda a, b: b
i = u = z = lambda z: z
f = lambda x: x + 'Fizz'
b = lambda x: x + 'Buzz'
p = print
a = lambda x, f: x and f(x) or f
[reduce(a, j) for j in islice(zip(count(),
repeat(d),
cycle((f, i, z)),
cycle((b, u, z, z, z)),
repeat(p)),
*args)]
fizzbuzz(1, 100)
It seems to be Python 2. Sigh…
Rust looks okay, though.