Fucking rent free. Jesus Christ you clowns, I almost want them to take away all your video games now
Good if you are rated by an AI that pays for LOCs.
that's some good code right there
When did Thor become the dev for Yandere Simulator?
To be fair, the question is "Write a function that simultaneously determines if the number is even and works as a timer"
sleepSort meets sleepIsEven
Why is it all in italics?! I’d reject the PR just for that. Otherwise LGTM
I hope that the language's int
s are at most 32 bits. For 8 bits it could even be written by hand & the source code for a 32 bit version would only take up avg_line_len * 4GiB
space for the source code of the function. But it might take a bit of time to compile a version that supports the full range of 64 or 128 bit ints.
My mate, Paul, says all numbers after 700 repeat so we can stop there.
We just give them different names so you think they're going up.
Yeah but did you know he worked for Blizzard tho
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
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.