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
I am more amazed that he didn’t stop at 10 and think “damn this is tiresome isn’t there a one liner i could do?”. I want to know how far he went. His stubbornness is amazing but also scary. I haven’t seen this kind of code since back in school lol lol lol
I want to assess coders by lines written! The more the better!
Thanks to goodness, finally. A (giggle & snort) solid algorithm. There ya’s go set yer clocks & go get a haircut.
Good if you are rated by an AI that pays for LOCs.
This is why this code is good. Opens MS paint. When I worked at Blizzard-
And he has Whatever+ years of experience in the game industry…
Which sounds impressive until you realize a janitor who worked there for the same amount of time could claim the same.
no unit tests huh.
/s
This code would run a lot faster as a hash table look up.
In a Juliana tree, or a dictionary tree if you want. For speed.
I agree. Just need a table of even numbers. Oh and a table of odd numbers, of course, else you cant return the false… duh.
Can you imagine being a TA and having to grade somebody’s hw and you get this first thing? lmao
This joke was not written by the dude pictured. The author wrote a book of funny code jokes.
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
Y’all laugh but this man has amazing code coverage numbers.
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
def is_even(n: int) -> bool: if n < 0: return is_even(-n) r = True for _ in range(n): r = not r return r
He loves me, he loves me not
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 upavg_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, we just give them different names so you think they’re going up.
all you have to to is throw an exception if the number is bigger than 100, who even needs numbers that big anyways?