@wetsocks Based on the indentation errors, our spaghettier obviously copied lines from the first two functions into the third one. To their credit, they didn't make any global variables, and they probably didn't have a linter like luacheck to help them with that. I think this code is sincere.

Not sure what they were thinking putting 'number' in a table, though.

Follow

@wetsocks
By the way, your solution can be made even shorter:

return (number % 2 == 0) and "Even" or "Odd"

This works because the string literal "Even" is never false or nil. See lua-users.org/wiki/TernaryOper for details.

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.