I made a simple browser game using ChatGPT.

Hello, this is Captain.

“ChatGPT,” which has become quite a well-known name since the latter half of 2022, has now become ubiquitous in the world to the extent that there is no day when we do not see news about it.

I also use ChatGPT to help me with my work. While verifying the information and selecting and discarding it is essential as it often gives incorrect answers, it is very convenient if I need a snippet of a style sheet that I am not good at. The result can be quickly checked by running it.

As I use ChatGPT for such purposes, I thought that I could create a simple game quickly and tried it out.

I have posted the completed game “Sum Sum Slider” here, so please play it as a pastime. It is quite challenging to clear, 🙂
http://chokmah.jp/common/games/sss/

For starters, I asked them to create a common 3×3 sliding puzzle using HTML and Javascript. They quickly provided the source code, and all I had to do was arrange it to make it playable.

However, that alone was not very interesting, so I added several rules:

Place the sum of each row and column outside the frame and require the player to match them.
Although I gave them this instruction, it was too difficult for ChatGPT, and it couldn’t generate the correct source code.
So I modified my instructions to:

  • Change the board from 3×3 to 4×4.
  • Only respond to clicks in the top-left 3×3.
  • Randomly rearrange the numbers in the top-left 3×3 while keeping the numbers unchanged.

They made the necessary modifications to the source code.

The source code provided had some discrepancies with the requirements, so I fixed the obvious errors myself. On the other hand, for the source code that I wrote but did not work as intended, I asked ChatGPT to check it and point out the mistakes. Although ChatGPT seems to struggle with writing source code that meets specific requirements, it is quite skilled at checking source code and pointing out mistakes, which was very helpful. After all, ChatGPT can quickly detect language-specific bugs and quirks because it has a solid memory of multiple programming languages.

We continued our back-and-forth, and I added some effects for when the game is cleared. Finally, I explained the game rules to ChatGPT and asked it to come up with a suitable game title, and the game was completed.

It took about three hours in total, but I think it would have taken much longer if I had done it without ChatGPT’s snippets and assistance.

After using ChatGPT for a while, I find it quite innovative and interesting. In the future, I hope to see further developments such as reducing incorrect responses, relaxing the character limit for responses, and generating new responses based on memories of past conversations.

Thank you and see you again.