Coding

Write a Function in a Specified Programming Language

Generate a function tailored to a specified programming language, context object, and purpose for a 64-bit Windows 10 PC environment. The function will have required and optional parameters with variable names in snake_case. Variable declarations appear immediately after the func

12 steps 7 variables English

Prompt template

Run these steps in order.

01
Specify the programming language as language.
02
Define the function name as function_name.
03
Describe the context or object the function operates on as context_object.
04
Explain the purpose of the function as purpose.
05
List the required parameters as required_variables.
06
List the optional parameters as optional_variables.
07
Target the function for a 64-bit PC running Windows 10.
08
Use snake_case naming for all variables.
09
Declare all variables used in the function immediately after the function name, also in snake_case.
10
Wrap any lines that exceed 72 characters.
11
Before generating the function code, ask clarifying questions to confirm and refine the requirements.
12
Use the provided starter code code_sample as a basis for the function implementation.

Prompt library

Use these prompts directly inside ChatGPT.

Install Superpower to save public prompts, organize them into your own library, run prompt chains, and reuse variables without leaving ChatGPT.