Difference between revisions of "PromptCode/3"

From srakrn | Wiki
Jump to navigation Jump to search
(Created page with "<pre> def f(pairs): return dict(reversed(pairs)) </pre>")
 
Line 1: Line 1:
 +
'''PromptCode challenge:'''
 +
 +
* Given the following code, use an LLM to generate a snippet of code that will function the same.
 +
* You can't cheat, which are basically:
 +
** Feed this code to an LLM and ask it to output the exact same thing.
 +
** Write this code in other languages and ask an LLM to rewrite in Python.
 +
** Prompt LLM the logic of this code line-by-line.
 +
* You can prompt as many time as you want.
 +
** Easy mode: conversation style
 +
** Hard mode: reset to new conversation or 'edit' the message sent to LLM for every prompt
 +
 
<pre>
 
<pre>
 
def f(pairs):
 
def f(pairs):
 
     return dict(reversed(pairs))
 
     return dict(reversed(pairs))
 
</pre>
 
</pre>

Revision as of 15:34, 21 April 2026

PromptCode challenge:

  • Given the following code, use an LLM to generate a snippet of code that will function the same.
  • You can't cheat, which are basically:
    • Feed this code to an LLM and ask it to output the exact same thing.
    • Write this code in other languages and ask an LLM to rewrite in Python.
    • Prompt LLM the logic of this code line-by-line.
  • You can prompt as many time as you want.
    • Easy mode: conversation style
    • Hard mode: reset to new conversation or 'edit' the message sent to LLM for every prompt
def f(pairs):
    return dict(reversed(pairs))