Teknique is my middle name on Nostr: Next time you have a job interview where someone wants you to write fizzbuz... ``` ...
Next time you have a job interview where someone wants you to write fizzbuz...
```
#!/usr/bin/env python
from itertools import count, cycle
def fizzbuzz():
blank = [""]
yield from (
a + b or c
for a, b, c in zip(cycle((blank * 2 + ["fizz"])), cycle((blank * 4 + ["buzz"])), count(1))
)
lol = fizzbuzz()
for i in range(20):
print(next(lol))
```
If that doesn't short circuit the live coding portion of the day, you don't want to work there anyway.
Published at
2024-05-07 23:24:25Event JSON
{
"id": "675e254be04dca5d6f16b320f8f3376a28ce9646c7769ac457d3c85e42579bd7",
"pubkey": "8e62fbcc6147b475c3ee74999ea7bd16176f22e92b3aa86556a91033e24aab33",
"created_at": 1715124265,
"kind": 1,
"tags": [
[
"proxy",
"https://freeradical.zone/users/tek/statuses/112402383857452264",
"activitypub"
]
],
"content": "Next time you have a job interview where someone wants you to write fizzbuz...\n\n```\n#!/usr/bin/env python\n\nfrom itertools import count, cycle\n\ndef fizzbuzz():\n blank = [\"\"]\n yield from (\n a + b or c\n for a, b, c in zip(cycle((blank * 2 + [\"fizz\"])), cycle((blank * 4 + [\"buzz\"])), count(1))\n )\n\nlol = fizzbuzz()\nfor i in range(20):\n print(next(lol))\n```\n\nIf that doesn't short circuit the live coding portion of the day, you don't want to work there anyway.",
"sig": "e8607609d5ed7ecb6218d5cf448b3079ea6e4445297050c3f1a95c300b58afddc4403e410525ef55108e4ee67f3695c8f0df896c1c15180f489548dae2e79b97"
}