News for hackers. Stuff that matters.
[dead]
Re:A random dungeon generator that fits on a business card by samatman on Sunday February 18, 2024 @01:52PM (#39421871)
I sort of understand the knee-jerk reactions to this. Hacker News is for humans, not robots, and there was an annoying trend of commenters posting LLM-generated summaries of articles, which deserve to get flagged off the page until they stop.

But I find it noteworthy, and in fact impressive, that ChatGPT can de-obfuscate and discern the meaning of this code. Letting the rest of us know that is a worthy contribution to the discussion.

I would suggest leading with a clear statement of why you're posting chatbot output, though. Folks around here have an allergy to that sort of thing for a reason.

Re:A random dungeon generator that fits on a business card by EmberTwin on Sunday February 18, 2024 @02:26PM (#39422210)
ChatGPT is not de-obfuscating this code. For one thing:

> basic cellular automaton algorithm

is completely wrong. A cellular automaton is a standard approach to level-generation in a roguelike, but this code implements a different approach, the rooms-and-corridors one.

Another issue here is that ChatGPT is using a few key context clues to make its (incorrect but plausible) guess. Robert Nystrom, aka munificient, is well-known in the roguelikedev community for his game programming tutorials. I confirmed that ChatGPT knows who he is by asking "Who is @munificentbob and what is he known for?" The name of the function, "cave", that carves rooms makes it clear that this is some kind of level-generation algorithm - in fact, that's probably where the incorrect guess about cellular automata came from, because those algorithms are often used for "caves" (versus "dungeons" made with rooms-and-corridors). The characters printed are also roguelike standards.

If I remove @munificient's name and rename "cave" to "X", ChatGPT's output is worse. It says: "This code is a compact implementation of a simple game where characters move around a grid.", which is...vaguely in the ballpark.

Re:A random dungeon generator that fits on a business card by gkbrk on Sunday February 18, 2024 @12:21PM (#39420919)
In what way is what ChatGPT outputs when asked about this code relevant? There are more than 20 LLMs, do we expect to see a comment from each LLM about code submissions?
Re:A random dungeon generator that fits on a business card by ianbicking on Sunday February 18, 2024 @12:24PM (#39420949)
The code isn't very readable in the submitted form, so I appreciated the interpretation, whether or not it's ChatGPT or something else.
Re:A random dungeon generator that fits on a business card by jprete on Sunday February 18, 2024 @07:01PM (#39424832)
The interpretation is not correct, according to this comment: https://news.ycombinator.com/item?id=39422210
Re:A random dungeon generator that fits on a business card by sowbug on Sunday February 18, 2024 @12:31PM (#39421031)
I'm not proficient at reading minimized code. Maybe you're better at it than I am. The ChatGPT output helps kickstart a meaningful discussion about the content of the code.
Re:A random dungeon generator that fits on a business card by kemotep on Sunday February 18, 2024 @12:45PM (#39421175)
It would probably help if you included that context in the beginning of the comment. Not just dumping ChatGPT output.

From an outside observer it just seems like you wanted ChatGPT to contribute on your behalf, not start a discussion of the code.

Re:A random dungeon generator that fits on a business card by sowbug on Sunday February 18, 2024 @12:51PM (#39421232)
Fair enough. The Overton Window shifts quickly these days.
Re:A random dungeon generator that fits on a business card by sunbum on Sunday February 18, 2024 @12:24PM (#39420941)
This is what I have to say about this comment === Why... Why would you do this, in what world does this contribute to the discussion? ===
Re:A random dungeon generator that fits on a business card by sowbug on Sunday February 18, 2024 @12:32PM (#39421038)
See my reply to the sibling comment.
Re:A random dungeon generator that fits on a business card by 8organicbits on Sunday February 18, 2024 @12:28PM (#39420998)
One of the comments has the unobfuscated and commented version: https://gist.github.com/Joker-vD/cc5372a349559b9d1a3b220d5ea...
Re:A random dungeon generator that fits on a business card by sowbug on Sunday February 18, 2024 @12:32PM (#39421048)
Aha, I didn't see the comments to the Gist. Thanks for that.