|
Points for being clever.
Sadly, someone would still use it...
|
|
|
|
|
If someone really uses it, he or she deserves it 
|
|
|
|
|
Sometimes the best thing you can do is let others hang themselves.
Figuratively speaking.
|
|
|
|
|
No...only positive integers. Since this is JS, some jerk could pass a float in and get your recursive function to march off the negative end of the numbers.
|
|
|
|
|
Hmmm, you are right.
The the improved improved version.
function IsEven(number) {
if (number === 1) return false;
else if (number ===2) return true;
else if (number > 2) return IsEven(number - 2);
else return IsEven(number + 2)
}
Now it does negatives too
EDIT: because I get serious reactions on this code
The code above is how NOT to do it - it's satire.
modified 20-Aug-21 8:19am.
|
|
|
|
|
And now this line of code is used:
IsEven (4.2);
It'll bounce around 0 until the heat death of the universe.
|
|
|
|
|
You are taking this code seriously?
|
|
|
|
|
..yes..is there anything else i should be serious about?..
🤪🤪🤪🤪
|
|
|
|
|
Why are all the 'else's there? Do they improve code generation?
|
|
|
|
|
No, they worsen it 
|
|
|
|
|
With big number (I mean really big numbers), you will run into a StackOverflowException.
What about "tail recursion"?
Oh sanctissimi Wilhelmus, Theodorus, et Fredericus!
|
|
|
|
|
|
|
I'm trying to guess what certain CPers would do if they were confronted with this person.
JSOP - bullet in the guy's head to put both the guy and everyone else out of their misery.
honey the codewitch - After she quit twitching, she'd write a parser to optimize the code.
OriginalGriff - figures out how to turn it into a CCC clue
Nagy - just wanders off, asking where the gin is.
Me - I'd tell him to turn it all into a switch statement.
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|
|
I'd side with JSOP, after I made them delete everything.
|
|
|
|
|
Me: Have Security dress the guy in a hazmat suit, and escort him out of the building.
I'd then cordon off the area and decontaminate everything he touched on his visit - in an autoclave, by choice. This level of stupidity leaves traces wherever it goes.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Daniel Pfeffer wrote: I'd then cordon off the area and decontaminate everything he touched on his visit - in an autoclave, by choice
Anything wrong with fire?
|
|
|
|
|
..better be ready..you cant fight fire with fire..
..you might be burned..
..were you?..
🤠🤠🤠🤠
|
|
|
|
|
You know... It's 2021, and the IRONY flows freely in all things...
I expected to see a macro (written in JavaScript), that writes the javascript file:
for (x..)
if x % 1 == 0 write "if (number == " + x +") return false;"
else write "if (number == " + x +") return true;"
==
And to see him asking people to crowd source running that file, to help him out!
==
Next question... Where is his test harness... Or is he caught in an infinite loop?
|
|
|
|
|
They've missed a whole set of entries for those that speak British style English.
American: Thirty-Two Thousand One Hundred Twelve
British: Thirty-Two Thousand One Hundred And Twelve
I'd better get editing...
|
|
|
|
|
|
Now the question is...
Is the one with that request trolling him? Or does he really needs it for his usage?
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpful answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Well, my comment on that issue requesting support for the Yan tan tethera[^] counting system was perfectly legitimate.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
..got it perfectly..but are we on the same page? really?..
😇😇😇😇
|
|
|
|
|
The AND denotes the decimal or fractional portion of the number. So Brits in the example above, Twelve whats?
I’ve given up trying to be calm. However, I am open to feeling slightly less agitated.
|
|
|
|