use the following search parameters to narrow your results:
e.g. subreddit:pics site:imgur.com dog
subreddit:pics site:imgur.com dog
advanced search: by author, sub...
~4 users here now
ProgrammerHumor
Would there be a faster version of this function?
submitted 3 years ago by zyxzevn from self.ProgrammerHumor
function MyFunc(number) { var res = true; if( number>0 ){ res=! eval("MyFunc"+ "(number-"+ "1)" ); } return( res); }
(from shitty programming)
[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - 3 years ago (1 child)
I really don't know what your actually trying to do here but I know for sure I could write some haskell achieving about the same with a standard python coder understanding even less of it.
If you want this one in really funny you try this in elixir.
It's the only compiler I know that just says "no".
[–]zyxzevn[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - 3 years ago (0 children)
On reddit /r/shittyprogramming we had some contests about who could make the most shitty implementation of "IsEven". There were worse solutions than this one.
In my implementation I used the build-in Eval() function of javascript to recursively. And it worked in my tests.
[–][deleted] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - (1 child)
[–]zyxzevn[S] 1 insightful - 1 fun1 insightful - 0 fun2 insightful - 0 fun2 insightful - 1 fun - (0 children)