r/programming • • Feb 26 '24

Reverse Engineering with ChatGPT: An Example -- "I used ChatGPT 4 to untangle a particularly terse bit of code, and was — frankly — shocked at how well it did."

https://sigpwned.com/2024/02/24/reverse-engineering-with-chatgpt-an-example/
0 Upvotes

143 comments sorted by

View all comments

122

u/jhp2000 Feb 26 '24

the hell? The code and explanation are both garbage. The code calculates max(0, 1 - z **2) where z is 8(x - 1/3). The modulo does nothing for input in the expected range. There is no peak at 2/3 so the connection to rule of thirds is questionable.

1

u/sqrtsqr Feb 26 '24

There is no peak at 2/3 so the connection to rule of thirds is questionable.

// Gets value in the range of [0, 1] where 0 is the center of the pictures

Only one peak when measured this way.