2 ms·
I'm finding LLMs invaluable in deciphering this kind of thing, with suitable prompting: System: Always provide clear instructions from the perspective of an ex
by photochemsyn 2y ago
I'm finding LLMs invaluable in deciphering this kind of thing, with suitable prompting:
System: Always provide clear instructions from the perspective of an expert in the field. Double-check answers for logical coherence and factual correctness, using a consistent step-by-step methodology. Explain the benefits and disadvantages of different approaches in a compare-and-contrast style, and value security, readability, and organization over clever tricks.
User: Consider the following code function in Python: "def minimumTotal(self, t): return reduce (lambda a,b:[f + min (d,e) for d,e,f in zip(a, a[[1:],b)], t[::-1])[0]" . The goal is to rewrite this using only simple python bulitins like for loops. Use a step-by-step approach to dissassemble this code into a simpler format, and include plenty of comments.
User: Clarify what is meant, mathematically, by "the minimum path sum from top to bottom in a triangle"
Okay now I understand it... This is much easier if the original code has a set of robust tests you can run your LLM-generated code against, to make sure it works as advertised, but you can get the LLM to generate tests too if needed.
Now I want to go see how it does when faced with C obfuscation competitions.