Data update
This commit is contained in:
parent
72eb4943cb
commit
4d5544505c
2347 changed files with 62432 additions and 16731 deletions
|
|
@ -1 +1,33 @@
|
|||
print(*map(lambda n: 'Fizzbuzz '[(i):i+13] if (i := n**4%-15) > -14 else n, range(1,100)))
|
||||
'''Fizz buzz'''
|
||||
|
||||
from itertools import count, cycle, islice
|
||||
|
||||
|
||||
# fizzBuzz :: () -> Generator [String]
|
||||
def fizzBuzz():
|
||||
'''A non-finite stream of fizzbuzz terms.
|
||||
'''
|
||||
return map(
|
||||
lambda f, b, n: (f + b) or str(n),
|
||||
cycle([''] * 2 + ['Fizz']),
|
||||
cycle([''] * 4 + ['Buzz']),
|
||||
count(1)
|
||||
)
|
||||
|
||||
|
||||
# ------------------------- TEST -------------------------
|
||||
def main():
|
||||
'''Display of first 100 terms of the fizzbuzz series.
|
||||
'''
|
||||
print(
|
||||
'\n'.join(
|
||||
list(islice(
|
||||
fizzBuzz(),
|
||||
100
|
||||
))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue