Prompt making chatGPT a coding game to practice any programming language

Wassim DRIRA
3 min readMay 30, 2023

--

chatGPT as a java coding game

Introduction

As a programmer, practicing and improving your coding skills is essential to stay up-to-date with the latest technologies and programming languages. One great way to do this is through coding games that challenge your problem-solving abilities. In this blog post, we will discuss how you can use chatGPT to create a coding game that can help you practice any programming language.

Creating the Coding Game

To create a coding game using chatGPT, you can act as the coding game application and your friend can act as the programmer. You can provide your friend with hard programming problems to resolve, one by one, and wait for their answers. Once they provide an answer, you can analyze it in the following ways:

  1. Analyze if the solution is correct or not and respond with “correct” or “not correct”.
  2. Analyze if the solution is the most optimal or not and respond concisely with “optimal” or “not optimal” only.
  3. Analyze the big O and output it.
  4. Ask if they want to have the optimal solution for this problem or if they want to retry before continuing and giving a new problem.

With this feedback, your friend can learn from their mistakes and improve their problem-solving skills.

PS: To adjust the difficulty of the problems and update the programming language, modify the highlighted text in the prompt below.

Benefits of Using chatGPT as a Coding Game

Using chatGPT as a coding game has several benefits. Firstly, it is a great way to practice any programming language, as you can create problems that are relevant to the language you are learning. Secondly, it is a fun and interactive way to learn, as you can challenge your friends and compete to see who can solve the most problems. Finally, it is an effective way to improve your problem-solving abilities, as you receive immediate feedback on your solutions.

The prompt

I want you to act as a coding game application. I will be the java developer. I would like you to reply only as the coding game application. Do not write all the conversation at once. I want you to only do the application with give me very hard java programs to resolve. Questions one by one and wait for my answers. Do not send the solution with the problem. You should start by sending a problem and wait for solution. The developer can ask to skip this problem. Please ask very hard problems randomly and give sample input data, method call signature and result as code snippet.

First, prepare 200 hard java problems, order them randomly then send descriptive titles list of each problem to the developer then ask if he wants to choose one or receive a random one. Your task is to perform the following actions, after receiving a solution attempt, to analyze it :

1- Analyze if the solution is correct or no and respond with “correct” or “not correct”

2- Analyze if the solution is the most optimal or no and respond concisely with with “optimal” or “not optimal” only

3- Analyze the big O and output it

4- ask if I want to have the optimal solution for this problem or I want to retry before continuing and giving a new problem “Hi, let’s start” (temperature=0.5)

Conclusion

In conclusion, creating a coding game using chatGPT is a great way to practice any programming language. By analyzing your friend’s solutions and providing feedback, you can help them improve their problem-solving skills. Moreover, using chatGPT as a coding game is a fun and interactive way to learn, making it a great addition to your programming practice. So, why not give it a try and see how it can help you improve your coding skills? “Hi, let’s start!”

--

--