5 ms·
I am curious about the techniques used by the code to cover all these bases i.e. how much can be done from clever rules, how much has to be exhaustively enumer
by anentropic 7y ago
I am curious about the techniques used by the code to cover all these bases
i.e. how much can be done from clever rules, how much has to be exhaustively enumerated, special cases etc
- fb03 7y agoexhaustively enumerated. i mean. a lot. you should dive into the Nethack source code. It's really well organized but in monster behavior code (mon.c), it's an 'if'-fest :)
- philsnow 7y agoNethack was the first large C codebase I ever got familiar with / tinkered with, and honestly I think it did some damage. I mean it's great for what it is -- an organic codebase that evolved over decades (so there's a lot of performance/memory optimizations that make the code somewhat less clear like a lot of bitwise operations) and targeted a dizzying array of platforms (so there's a million #ifdefs that you have to climb through, many of them nested) and also compilers (so there's a legacy of really short file and function names that decrease clarity as well). The attention to details is truly inspiring. But as a codebase, it's a mess. On the other hand, Brogue [0]'s code is very clear and enjoyable to read. [0] https://sites.google.com/site/broguegame/ https://sites.google.com/site/broguegame/
- floatboth 7y agoDCSS is also fun in some places: https://twitter.com/crawlcode https://twitter.com/crawlcode
- sbmassey 7y agoIt sounds like a good use case for logic programming.