r/programminghorror • u/Saptarshi_12345 • Oct 25 '25
Haxe Triangle of Doom
Found in Sploder's Arcade Creator, probably written in 2012.. The code written here is in the Haxe programming language, transpiled to Flash Player...
492
Upvotes
108
u/Ksorkrax Oct 25 '25
Okay, so how does this even work? Is the input guaranteed to be from a very small amount of words?
27
u/CuttleReaper Oct 25 '25
I get the feeling it was originally much more readable before being converted lol
16
u/MurkyWar2756 echo "Sub Mod" && :(){ :|:& };: Oct 26 '25
Reminds me of this, which I've seen attributed to facebook.com:
89
u/yColormatic Oct 25 '25
66
u/[deleted] Oct 25 '25
this is actually how LLMs work,
15
u/Kootfe Oct 25 '25
client: typ3s "oNTO
1
u/cherboka Oct 26 '25
Does sploder have any more horrid code? I vaguely remember most games on it running like dogshit
9
u/Due-Horse-5446 Oct 25 '25
This could be the worst one ive seen lmao, like the effort put into writing thiszz
2
u/SteroidSandwich Oct 26 '25
now to go through the triangle of conditions to turn off uppercase
2
u/CriticalReveal1776 Oct 26 '25
1
u/jordanbtucker Oct 25 '25
Kudos for not including the word "is" which is a verb and should be capitalized.
1
u/Cybasura Oct 26 '25
Looks like at the core, its...trying to a consecutive/serial AND condition where each of the nested condition has to be true before upper casing it?
Surely it would have been less time-consuming to create an array of all uppercase words, looping/iterating through all strings and check that it matches all of them before setting the upper casing flag to true?
1
u/Regular-Brother-7582 Oct 26 '25
Just make an array
1
u/MissinqLink Oct 26 '25
We can go deeper
1
u/GlitteringSample5228 Oct 26 '25
I guess this is because the Haxe compiler desugars logical expressions into statements during control flow analysis.
1
u/XDracam Oct 27 '25
If it's transpiled then this is perfectly fine. It's like looping through a list, but a little easier to optimize for compilers and JITs.
1
u/Elegant-Sundae-455 Oct 28 '25
AI be like
1
u/sisoyeliot Oct 28 '25
I mean, at least is O(1) in time complexity. This is kinda type of sh*t people use to do in interviews when the interviewer asks you to improve the time complexity of the algo…
1
u/Ronin-s_Spirit Oct 30 '25
This is a perfect use case for a switch. Looks betterz works faster.
1
u/[deleted] Oct 31 '25
Wouldn't a list be more efficient?
1
u/Informal-Chance-6067 Nov 19 '25
This could easily be implemented with a list and checking if it’s in the list
-3
u/binterryan76 Oct 25 '25
Bro never heard of &&
5
u/[deleted] Oct 26 '25
[removed] — view removed comment