Not to take from all the funny answers ... but
bool IsEven(int i) => (i & 1) != 1;
(C#)
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Not to take from all the funny answers ... but
bool IsEven(int i) => (i & 1) != 1;
(C#)
Though, obviously I had to come up with some ridiculous solutions:
bool IsEven(int i) => ((Func<string, bool>)(s => s[^1] == 48))($"{i:B}");
This one works without conditionals :)
bool IsEven(int i)
{
try
{
int _ = (i & 1) / (i & 1);
}
catch (Exception)
{
return true;
}
return false;
}
Try coding chess next time
See ya in a few years
Lol the amount of bullying this guy is getting lately. I've seen similar spins and bends that looks somewhat legit, making people believe he suck at coding