Skip to content

Instantly share code, notes, and snippets.

@metatoaster
Last active September 18, 2017 05:22
Show Gist options
  • Select an option

  • Save metatoaster/3d531177ecb8f803d633551b3fc824a8 to your computer and use it in GitHub Desktop.

Select an option

Save metatoaster/3d531177ecb8f803d633551b3fc824a8 to your computer and use it in GitHub Desktop.
def fizzbuzz():
import random
def magic(number=24866068):
while True:
random.seed(number)
for x in range(15):
n = int(random.random() * 10000) % 4
yield 'fizzbuzz'[(n*4-4)%8:n*4]
for i, m in zip(range(1, 101), magic()):
print(m or i)
import random
print('\n'.join(m or str(i) for i, m in zip(
range(1, 101), (i for sl in (('fizzbuzz'[(n*4-4)%8:n*4] for n in (
(int(random.random() * 10000) % 4) for _ in range(15)))
for _ in range(7) if not random.seed(24866068)) for i in sl))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment