Javascript |
|||||||||||
Pong Game - I
In this note, I wanted to try a little bit different approach. As you might have noticed, I used to put the detailed and step-by-step requirement to chatGPT. But I didn't put may own version of the detailed requirement for two reasons.
Then I thought 'what if I ask chatGPT to write the step by step procedure and ask it to implement the code for it'. The outcome is impressive at least in my personal standard. NOTE : I noticed that chatGPT can make mistake in logics of the code, not about the simple syntax error. Very much like human programmer :). It took me a lot of back-and-forth between me and chatGPT just to find two lines of the logical mistake. Except those two lines of mistakes, overall code was working fine.
This code is created first by chatGPT on Jan 18 2023 (meaning using chatGPT 3.5). The initial conversation started as follows.
First I asked chatGPT to write a step by step procedure.
It came out with the procedure as below.
The I copied the procedure except the last to two steps to make it simpler and pasted into chatGPT as my request.
NOTE : It is not guaranteed that you would have the same code as I got since chatGPT produce the answers differently depending on the context. And it may produce the different answers everytime you ask even with the exact the same question. NOTE : If you don't have any of your own idea for the request, copy my request and paste it into the chatGPT and put additional requests based on the output for the previous request. I would suggest to create a new thread in the chatGPT and put my request and then continue to add your own request.
Usage : Press Q or A key to move left paddle and Press W or S to move right paddel.
| |||||||||||