When did Thor become the dev for Yandere Simulator?
Programmer Humor
Post funny things about programming here! (Or just rant about your favourite programming language.)
Rules:
- Posts must be relevant to programming, programmers, or computer science.
- No NSFW content.
- Jokes must be in good taste. No hate speech, bigotry, etc.
Thanks to goodness, finally. A (giggle & snort) solid algorithm. There ya’s go set yer clocks & go get a haircut.
this is like the making chess one
The end user yearns for their machine to be utilized fully, so instead of that, you can import full deepseek model to do the task
Throwback to when someone shared the OG version of this meme to my uni chat, I replied with "Oh you can simply do
def is_even(n: int) -> boolean:
if n > 0 return not is_even(n - 1)
elif n < 0 return not is_even(n + 1)
else return True
And instead of laughing at the joke the TA in the chat said "When you start getting internships you'll do n % 2
" like I was being serious.
private bool isEven(int number){
bool result = true;
while (number > 0){
number = number - 1;
if (result == true)
result = false;
else
result = true;
}
return result;
}
(P.S.: Only works for positive numbers)
This works for both positive and negative numbers:
private static bool isEven(int number)
{
bool result = true;
while (number < 0)
{
number = number - 1;
if (result == true)
result = false;
else
result = true;
}
while (number > 0)
{
number = number - 1;
if (result == true)
result = false;
else
result = true;
}
return result;
}
Output:
isEven(4) = True
isEven(5) = False
isEven(-4) = True
isEven(-5) = False
Would this be a case of modulo saving the day?
Like: If Number modulo 2 = 0, true
This has to be taken out of context
private?
Why is it all in italics?! I’d reject the PR just for that. Otherwise LGTM