Someday, I might get around to writing a blog post about my optimized assembly implementation of Fizzbuzz, but I'm not quite done with it yet. There's some tricks I want to use that involve AVX512, and my current PC doesn't support it.
sin(x) will only ever be an integer for an integer x when x is 0 (this is because pi is irrational)
Hence, the statement int(np.sin(num-1) == int(np.sin(num-1))) checks if num - 1 is equal to zero, and gives 1 if it is zero, and 0 if it is not zero. This selects either the comma or the empty string from the list. This then recurses up to put commas between the items in the list, but not before the first item.
51
u/bonafidebob Jun 19 '21
I'll just leave this here: Fizz Buzz in Tensorflow
11
u/ThaiJohnnyDepp Jun 19 '21
Egg?
7
u/t3hcoolness Jun 19 '21
Holy shit, what. How the hell does a sine function work into this
4
u/PityUpvote Jun 19 '21
This is genius.
2
u/KyleDrogo Jun 19 '21
> egg
1
u/66bananasandagrape Jun 20 '21
import numpy as npcould becomeimport math as nplol0
u/[deleted] Jun 19 '21
[deleted] — view deleted comment