4 ms·
I was really inspired by this post, so I decided to make Tetris in JavaScript using (almost) entirely using code generated by ChatGPT. And I must say it's reall
by aadnk 4y ago
I was really inspired by this post, so I decided to make Tetris in JavaScript using (almost) entirely using code generated by ChatGPT. And I must say it's really impressive, though it does make mistakes here and there. But if you test the generated code thoroughly and provide clear feedback to GPT, it can actually mostly do it.
I've uploaded the game along with the chat session on GitHub:
https://github.com/aadnk/TetrisChatGPT https://github.com/aadnk/TetrisChatGPT
The main issue seems to be that it can only generate short snippets at a time, due to some maximum output size, and it does start to forget (likely due to a limit in the prompt size) bits and pieces of the program that is being developed. But if you focus on single methods and occasionally refresh the prompt with the state of the current program, you should be able to write relatively complex programs. Provided that you can also debug the program while its being written ... Now, I did perhaps give GPT too many clues in my feedback in how to fix the bugs it created. It would be interesting to see how someone with less experience in a language would fair with ChatGPT.
- cbm-vic-20 4y agoYour "conversation" with ChatGPT is similar to how a conversation would go with a junior developer who misses edge cases and nuanced situations, and needs some guidance to get them back on track.