Files
my-vault/00_Inbox/Clippings/2023/04/Most Useful ChatGPT Prompts.md
T

50 lines
2.1 KiB
Markdown
Raw Normal View History

2026-01-05 13:03:55 +08:00
---
page-title: "Most Useful ChatGPT Prompts"
url: https://www.explainthis.io/en/chatgpt
date: "2023-04-20 08:56:52"
---
Copy
##### Write a function
Your are programming language expert, please write a function that can do something.
👉 You are a JavaScript expert, please write a function that can do input a one-dimensional array, convert this one-dimensional array into a two-dimensional array. At the same time, I can freely decide the length of the subarray in the two-dimensional array.
Copy
##### Explain Code
You are a programming language expert, please explain the following code to me. attach code
👉 You are a Rust expert, please explain the following Rust code to me. \[attach code\]
Copy
##### Refactor Code
You are a Clean Code expert, I have the following code, please refactor it in a more clean and concise way so that my colleagues can maintain the code more easily. Also, explain why you want to refactor the code so that I can add the explanation to the Pull Request. attach code
Copy
##### Debug
You are a programming language expert, I have a piece of code and, I expect this code to do something, but it fails the test case. Please help me find out what I did wrong and rewrite it in the correct way. attach code
👉 You are a C++ expert. I have a piece of code and I expect this code to check if a string is a palindrome, but it fails the test case abbccde. Please help me find out what I did wrong and rewrite it in the correct way. \[attach code\]
Copy
##### Write test
You are a programming language expert, I have a piece of code attach code, please write tests for it. Please provide at least number test cases, and cover the extreme cases, so that I can be sure that my code is correct. attach code
👉 You are a python expert. I have a piece of code \[attach code\], please write a test for it. Please provide at least 5 test cases, and cover the extreme cases, so that I can be sure that my code is correct. \[attach code\]
Copy
##### Write Regex
You are now a Regex Expert, please write a Regex that can do something
👉 You are now a Regex Expert, please write a Regex that can extract all the numbers from a string