Hacker News new | ask | show | jobs
by CamperBob2 882 days ago
I just asked it to reformat the code for better readability, and it guessed it was a ray tracer. I for one welcome our new robot^H^H^H^H^Hparrot overlords.

Also tried having it generate a JavaScript version, but the output doesn't look right: https://chat.openai.com/share/5d76e32b-81a1-4b4a-a808-7682a8... I'd be inclined to suspect the lack of line numbers, as a first guess towards the problem.

1 comments

Hah! The code doesn't work because chatGPT missed a very obscure trick...

At the start of the code is a comment "REM xxxxxx". It stripped this comment out thinking it was junk.

But actually, the code later uses the "PAGE" command to directly read RAM to get the contents of this comment, which it then uses as a lookup table for dithering.

Actually I did that (note that the REM is missing from my prompt.) It didn't look like a hack for embedding binary data for subsequent PEEK or CALL statements, which was common on the 8-bit Apple I grew up using, so I assumed it was just garbage and left it out.

When I fed it your updated version that didn't include the REM, farther down the page, it still didn't quite work. Although I can tell it's not too badly broken. There's some visual structure in the output, just not the expected image.