Infallible Code
-
Even plus even equals even.
Odd plus odd equals even.
Only odd plus even makes an odd.
Are there twice as many even numbers as there are odd numbers?
Even plus even
Odd plus odd
Even plus odd
Odd plus even
-
Even plus even
Odd plus odd
Even plus odd
Odd plus even
Are we working with a non-abelian group? Other wise this would work.
-
I’m the first ever second generation Blizzard employee!
This is such an unhinged thing to say, it had me rolling.
-
Did you know that he worked for Blizzard for seven years? Not only that, but he was Blizzard's first second-generation employee. He grew up in Blizzard. An extreme accomplishment to be certain. Thank you based and blizzpilled Pirate Software.
I wonder if he was the one stealing the breast milk. After all, I've heard he can be really childish.
The funniest thing about his blizzard obsession and the fact that his dad is like a first generation blizzard employee is such a weird glex these days.
So, did you get to harass any women yourself, or did you get your dad watch doing it? Were you a high enough employee that they gave you the Bill Cosby room to rape someone?
-
I removed the tail recursion for you:
private book IsEven(int number) { if(number > 1) return IsEven(number - 2) == true; if(number == 0) return true; if(number == 2) return false; }
What'd be the result for
IsEven(1)
? -
This noob even forgot zero
That and all negative values
-
What'd be the result for
IsEven(1)
?Stack overflow
-
Pah, mathematicians and their generally applicable pure approach to solutions and fancy modulus operations, who needs 'em? Computing is applied and we always work with well-defined finite precision. Granted, writing the boilerplate for all possible 64 bit integers is a bit laborious, but we're programmers! That's what code generation is for.
You can generate the code with a simple macro.
-
That and all negative values
Patience guys, I'm sure they'll get to supporting zero and negative integers as soon as they finish all positive integers
-
We can avoid expensive branches (gasp) by using some bitwise arithmetic to achieve the so-called "absolute value", an advanced hacker technique I learnt at Blizzard. Also unlike c, c# is not enlightened enough to understand that my code is perfect so it complains about "not all code paths returning a value".
private bool IsEven(int number) { number *= 1 - 2*(int)(((uint)number & 2147483648) >> 31); if (number > 1) return IsEven(number - 2); if (number == 0) return true; if (number == 1) return false; throw new Exception(); }
Nice, now we just need another function to find odd numbers, cause not all numbers are even you know.