Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on The Cursed Computer Iceberg Meme. Parent comment
import itertools # this block is just for simple functional pipes class B: def __init__(self, f): self.f = f class Pipe (B): __ror__ = lambda self, x: self.f(x) class Map (B): __ror__ = lambda self, x: map (self.f, x) class MapValues(B): __ror__ = lambda self, it: it | Map(lambda kv: (kv[0], self.f(kv[1]))) # here the actual FizzBuzz ( range(1, 100) | Map(lambda i: (i, itertools.compress(('Fizz', 'Buzz'), (i % 3 == 0, i % 5 == 0)))) | MapValues(''.join) | Map(lambda kv: kv[1] or kv[0]) | Pipe(list) ) [1, 2, 'Fizz', 4, 'Buzz', 'Fizz', 7, 8, 'Fizz', 'Buzz', 11, 'Fizz', 13, 14, 'FizzBuzz', 16, 17, ... ]
https://github.com/tandav/pipe#fizzbuzz
There are no comments on this comment yet.
https://github.com/tandav/pipe#fizzbuzz