Defining a clear, actionable prompt ensures accurate LLM responses.
Copy
Ask AI
system_prompt = "You are a helpful coding assistant that can generate and execute python code. ""You only respond with the code to be executed and nothing else.""Strip backticks in code blocks."prompt ="Write a Python script that generates a maze. The script should:""1. Accept a size parameter from command line arguments""2. Generate a random maze of the specified size. Remember to make the maze solvable ""and easy and to make it clear the outer borders of the maze.""3. Print the maze where '#' represents walls and ' ' represents paths.""Mark the Maze start with 'S' and end with 'E'""4. Use argparse for command line argument parsing""The code should be in the format of a Python script that can be run directly""with 'python gen_maze.py --size 5'.""ONLY output the code and do NOT wrap the code in markdown! The code should begin ""with an import and end with a print statement."