Exploring the magic and limitations of ChatGPT in generating Python code for acoustic design - Day 5
- INAcoustical
- Jun 6, 2023
- 1 min read
Day 5: Writing effective prompts for coding
Task: Divide the audience plane into segments and assign colours from a colour palette based on the received percentage of sound power
The following is a summary of the prompts I found useful for coding. They have been frequently employed in creating the Grasshopper components for the task demonstrated in the video:
For finding structures and functions: Create a structure template to achieve this objective.
For better understanding of function usage: What is the purpose of this function?
For debugging: What is the issue with this code?
For code optimization: Simplify this code.
For code optimization: Refactor this code to improve efficiency.
For code optimization: Is there a more effective approach to achieve the desired outcome?
For code testing: Test this function using 5 cases.
For code documentation: Include a detailed and high-quality docstring for the code below.
For code documentation: Provide an explanation for this code to document its functionality.
Comments