My Silly IsEven Function
Recently, this tweet by Kat Maddox aka @ctrlshifti has been making the rounds on Twitter. The replies quickly turned into a competition to write the most cursed IsEven function possible. I decided to join in on the fun and after some experimentation, I came up with the following function written in C. int is_even(int n) { while (n >> 1) n *= n; return !n; } At first glance, this function looks like it wouldn't even terminate for most inputs, let alone return the correct result....