DEV Community

Gudasol
Gudasol

Posted on

Examining ChatGPT's Mad Code Skills with 48+ Prompts

Attention all Coders!

If you're looking catch up or stay ahead of the curve in AI programming, you’re in the right place.

I’ve put together a vast array of prompts covering everything from basic data structures and algorithms, to more advanced topics like developing applications and exploring new programming languages. While I'm mastering prompt engineering with programming, I'm also educating people about the power of ChatGPT, and how to to get code like this.

Image description

I see this shift to AI code as a great balancer of power. Now, we can can focus on the workflows, refining software architecture patterns, conceptualizing better, understanding the tools faster. To new students, we refocus on teaching the low-level optimizations that lead to good performance, and the high-level understanding that leads to wise decisions in package/library selection.

I’ve shared 50 Learning-oriented prompts here, find 100+ more practical examples in this Gumroad freebie

Happy to discuss prompt optimization/engineering in the comments. Or AI apocalypse, your choice 🤷‍♂️

type chat in the magic rectangle above and hit enter blindly trusting autocomplete; let's GOOO

Learn Algorithms

Build a linear search algorithm in Python to find a specific value in an array.
Write a bubble sort algorithm in Java to sort an array of integers in ascending order.
Develop a binary search algorithm in C++ to search a sorted array for a specific value.
Build a selection sort algorithm in JavaScript to sort an array of numbers.
Write a quick sort algorithm in Go to sort an array of strings in alphabetical order.
Develop a insertion sort algorithm in Python to sort an array of floats in descending order.
Build a counting sort algorithm in R to sort an array of positive integers.
Write a merge sort algorithm in Java to sort an array of dates in chronological order.
Develop a shell sort algorithm in C++ to sort an array of characters in lexicographical order.
Build a radix sort algorithm in JavaScript to sort an array of large integers.
Write a heap sort algorithm in Go to sort an array of arbitrary objects.
Develop a bucket sort algorithm in Python to sort an array of real numbers into uniform buckets.

Challenge

Please tell me you aren't just copy/pasting. Bro. Really. Bro.

Try to take this copy/paste result

Laxy man's AI prompt code

and make it look like this

Formatted Prompt Engineering Code

WITHOUT removing anything from the original prompt (you can add only at the beginning or end)

Here's the rest. Go get 'em, tiger

App + Tool Prompts

Build a code formatter in Python that formats and indents the given code according to a set of rules.
Build a regular expression evaluator in Java that takes a regular expression pattern and a string as inputs, and returns a boolean indicating whether the string matches the pattern.
Build a URL shortener in JavaScript that takes a long URL as input and returns a shortened URL.
Create a weather app in Ruby that displays the current weather conditions for a specified city.
Build a to-do list application in Swift that allows users to add, edit, and delete tasks.
Build a calculator in Go that takes mathematical expressions as input and returns the calculated result.
Create a file compression tool in C# that compresses and decompresses files.
Build a unit converter in R that converts between different units of Build.
Develop a color picker tool in Kotlin that displays a color wheel and allows users to select a color and see its RGB value.
Build a spell checker in Python that takes a string as input and returns a list of spelling errors, if any.
Create a password generator in Java that generates random, secure passwords of a specified length.
Build a currency converter in JavaScript that converts between different currencies based on real-time exchange rates.

Learn Programming

Write code snippets in Rust that demonstrate basic syntax, control structures, and data types.
Build a simple web application in Flask that displays a list of items and allows users to add, edit, and delete items.
Write a short program in a new functional programming language that Builds a Fibonacci sequence.
Explore a new game development framework by creating a simple 2D game with graphics and user input.
Write code snippets in a new system programming language that demonstrate how to work with file I/O and process management.
Build a simple data analysis tool in a new data science framework that reads a CSV file, performs some basic computations, and generates a visual report.
Write a short program in a new web development framework that Builds a basic RESTful API.
Explore a new machine learning library by creating a simple model that predicts the likelihood of a binary outcome based on some input data.
Write code snippets in a new database query language that demonstrate how to insert, update, and retrieve data from a database.
Build a simple chat application in a new real-time communication framework that allows multiple users to send and receive messages in real-time.
Write a short program in a new blockchain platform that Builds a simple smart contract.
Explore a new virtual reality framework by creating a simple VR experience with graphics and user interaction.

Intermediate Functions

Write a function that takes a list of numbers as input and returns the mode.
Build a function that takes a string as input and returns the longest palindromic substring.
Write a function that takes a list of strings as input and returns the list of anagrams.
Build a function that takes a list of numbers as input and returns the largest contiguous sum.
Write a function that takes a list of integers as input and returns a list of all the prime numbers.
Build a function that takes a string as input and returns a boolean indicating whether the string is a valid IP address.
Write a function that takes two strings as input and returns the edit distance between them.
Build a function that takes a list of numbers as input and returns the longest increasing subsequence.
Write a function that takes a string as input and returns the longest common prefix among all the words in the string.
Build a function that takes a graph as input and returns the shortest path between two nodes.
Write a function that takes a list of numbers as input and returns a list of all the combinations of the numbers that add up to a target sum.
Build a function that takes a list of strings as input and returns the longest common substring among all the strings.

Feedback - Learning Together

Share your experience in the comments, including unexpected behavior so I can update the prompts.

Tips:
Not getting code? Add “with code samples”
Not enough code? Ask to “Write [incomplete part of code]
Want a different language? Add “in [Language]”
Different stack? Add “using [List of libraries/packages]”
Commented? Add “with comments” or “using [documentation library/package]”

If that’s enough AI for one day, I understand. If you want more, you’ll find it in my Gumroad freebie. I’m continually updating the list there.

Top comments (0)