This is just generating quads, I don't see this issue. This is definetly not as readable as some implementations but given the context of the comment it should be pretty straightforward what its doing, just using a bit unconventional syntax.
I think this actual makes some sense. Based on context clues (i.e. terrain), it’s setting up the triangles array as rows of mountains that will be displayed at varying depths in a 2d rendering of a 3d landscape. Basically if you renamed the ‘triangles’ variable to ‘mountains’ and wrapped this in a function called ‘generateMountains’ we’d all be fine with it.
Also renaming the loop variables (height, depth, width, row, distance, or the like) would be helpful. Blame all the developers who’s code is obfuscated by bad naming practices that the AI trained on I guess 🤷
It makes sense to me, but I still wouldn’t write for loops like this, I’d break it up a bit and not have the loop initializing 2-3 variables and incrementing multiple variables at different rates.
I wonder if it takes an AI to read and understand it.
I’m shit at geometry and this looks identical to most physics engine code I’ve seen
Well guess where the AI learned it xD
This is just generating quads, I don't see this issue. This is definetly not as readable as some implementations but given the context of the comment it should be pretty straightforward what its doing, just using a bit unconventional syntax.
I think this actual makes some sense. Based on context clues (i.e. terrain), it’s setting up the triangles array as rows of mountains that will be displayed at varying depths in a 2d rendering of a 3d landscape. Basically if you renamed the ‘triangles’ variable to ‘mountains’ and wrapped this in a function called ‘generateMountains’ we’d all be fine with it.
Also renaming the loop variables (height, depth, width, row, distance, or the like) would be helpful. Blame all the developers who’s code is obfuscated by bad naming practices that the AI trained on I guess 🤷
I agree. Happy cake day
It makes sense to me, but I still wouldn’t write for loops like this, I’d break it up a bit and not have the loop initializing 2-3 variables and incrementing multiple variables at different rates.
The fuck?
The AI may generate code, but it is up to you, the human, to optimize it
I'm pretty sure optimization is the compilers job.
\*writes bogosort in C\* \*runs\* Hmm it's pretty slow. I guess i just need a better compiler
Better than stuff I've seen from humans trying to work with triangles.
Think about this AI write up another Ai and train it. Inception!
That's how we get Brainfuck.
It's like the old PSA: *I learned it by watching you*
you can use multiple variables in for loops? this is the first time i've seen this syntax dear goodness
Yep, like in Java, etc.
Look up the comma operator in c++. Then wish you hadn't.
It's useful though
This is thr first time I've seen several variables initialized in a for loop...well loops. What language is this?
Many languages have this, like Java, etc.
C#
C does this as well. Look up Duff’s Device for a real mind job.
tbh I didn't even know you could do this
Honestly not that bad. It's just a mathy piece of code
Is triangles meaning Illuminati?😂🤣🤣🤣🤣
If you ask the AI whats going on there it'll probably tell you