|
I'm sure this project is a gag! (and I'm snickering!)
Has anyone yet suggested porting this to some cloud-native database of the even numbers?

|
|
|
|
|
Feel free to suggest it[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
What? I am probably dumb, or inexperienced, or both, but I see no practical use for this.
Zaphod
|
|
|
|
|
What? I am probably dumb, or inexperienced, or both, but I see no practical use for this.
|
|
|
|
|
Thanks for sharing this… I was looking for a way to stripe my html tables!
|
|
|
|
|
That can be done better with a recursive function:
function IsEven(number) {
if (number === 1 return false;
elseif (number === 2) return true;
else return IsEven(number - 2);
}
Now it does all positive numbers
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.
|
|
|
|
|
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?
|
|
|
|