It can be funny, it can be mentally stimulating (encouraging lateral thinking), and in a way it also exercises/demonstrates a good familiarity with the language. Just as making highly optimized and streamlined code that works is indicative of good understanding and use of the tools available, so too is making
intentionally inefficient/unintuitive solutions.
Anyway, lemme see if I can transcribe this utter abomination here (Grasshopper, sadly, doesn't appear to have a readily available "copy" option for code snippets written in-program)
const alphabet = [
'a',
'b',
'c',
'd',
'e',
'f',
'g',
'h',
'i',
'j',
'k',
'l',
'm',
'n',
'o',
'p',
'q',
'r',
's',
't',
'u',
'v',
'w',
'x',
'y',
'z',
' ',
'A',
'B',
'C',
'D',
'E',
'F',
'G',
'H',
'I',
'J',
'K',
'L',
'M',
'N',
'O',
'P',
'Q',
'R',
'S',
'T',
'U',
'V',
'W',
'X',
'Y',
'Z',
'!'
];
Function PrintWord (word) {
let total = [];
let foo = '';
let bar = '';
for (var letter of word) {
for (let i = alphabet.length; i > 0; i--) {
if (i === 33 && foo.length < 1) {
foo = alphabet[i + 1];
} else {
if (i === 5 && (foo.length > 0 && foo.length < 2)) {
foo += alphabet[i - 1];
} else {
if (i === 12 && (foo.length >= 2 && foo.length < i / (i / ((true + true) * (true + true))))) {
foo += alphabet[i - true];
} else {
if (i === 15 && (foo.length >= i / 3 - true && foo.length < i / 3)) {
foo = foo + alphabet[i - true];
} else {
if (i === 23 && foo.length === alphabet.lastIndexOf('f')) {
let q = 'Why am I doing this?';
let a = [];
for (var y of q) {
a.push(y);
}
bar = a.shift();
} else {
if (alphabet[i - true] === 'o' && bar.length === alphabet.length / alphabet.length) {
bar += 'o';
} else {
if (i === 9 * 2 && bar.length === i / 9) {
bar = bar + alphabet[alphabet.length - 37];
} else {
if (alphabet / i === 4.5 && (bar.length > 2 && bar.length bar.length < 4)) {
bar += alphabet[alphabet.length / 4.5 - true];
} else {
if (i === alphabet.indexOf('e') && bar.length === foo.indexOf('o')) {
let envelope = [];
envelope.push(bar);
envelope.push(alphabet[foo.length - bar.lastIndexOf('r')]);
bar = envelope.join('');
}
}
}
}
}
}
}
}
}
}
}
total.push(foo);
total.push(bar);
return total.join(alphabet[alphabet.length / 2 - true]) + alphabet[alphabet.length - 1];
};
console.log(PrintWord('aaaaaaaaaa'));
This was copied by hand from looking at my phone, so there might potentially be some issues that I accidentally introduced. I haven't tested it yet in en environment that lets me loop more than 500 times (which means I haven't even confirmed that printing the whole string works in the phone's copy).
There are probably some opportunities for anti-optimization and obfuscation here, as I copied directly from Grasshopper and it has some built-in restrictions in usable commands and syntax.
EDIT: Whoops, apparently forgot that W was a letter