About FunctorX

(This English text has been translated using ChatGPT.)

Introduction

The purpose of this project is not to create "an interesting puzzle game" but to verify "the extent to which a program can be developed using ChatGPT." This puzzle is written in JavaScript. Over the past 25 years, I have primarily programmed in C and Python (occasionally), but I have very little experience with JavaScript. Therefore, this time, I decided to leverage the power of ChatGPT since studying JavaScript and writing the code would be challenging.

This game was inspired by Sumplete. While Sumplete involves addition, FunctorX deals with multiplication. I learned about Sumplete from the following article: Gigazine: "What is 'Sumplete,' an Actually Playable Original Puzzle Developed Using Chat AI 'ChatGPT'?" (in Japanese)

Regarding the creation of games with ChatGPT, I was also influenced by the following article: Kotori Piyopiyo: "Created a Game with ChatGPT in Just 10 Minutes" (in Japanese)

Implementation of FunctorX

I am interested in investigating the impact of ChatGPT on programming. As part of achieving that goal, FunctorX was developed.

ChatGPT can be used for various purposes, and one of them is generating code. When given "WHAT (what to solve)" as input to ChatGPT, it produces "HOW (how to solve)" as output. Looking at the past 80 years of computer history, even modestly speaking, this is quite remarkable. There is a possibility of significant transformation in intellectual work such as programming.

Currently, if we provide ChatGPT with the rules of FunctorX, it does not immediately generate playable code. GPT-3.5 does not seem to have such high capabilities. This is similar to the current state of 3D printers. They cannot create anything larger than themselves, and if you want to create something larger than a 3D printer, you need to make parts and assemble them. Similarly, FunctorX was divided into functional components, and ChatGPT was asked to generate small pieces of code for each component. These pieces correspond to the parts.

Assembling the parts into a finished product is the work of the developer (myself, a human) with guidance from ChatGPT, of course. So, when viewed by professional programmers, the codes they may find "messy" are usually the sections written by me, the human, in most cases.

While FunctorX is a byproduct of the process of verifying "the extent to which a program can be developed using ChatGPT," I hope you will enjoy it.

Yonezawa Naoki


FunctorXについて

はじめに

このプロジェクトの目的は「面白いパズルゲームを作ること」ではなく、「ChatGPTを使ってどの程度の規模のプログラムができるかを検証すること」です。 このパズルは、JavaScriptで書かれています。過去25年間、主にCとPythonでプログラムを(時々)書いてきましたが、JavaScriptの経験はほとんどありません。 JavaScriptを勉強してコードを書くのは大変なので、今回、ChatGPTの力を借りることにしました。

このゲームは、Sumpleteにインスパイアされました。Sumpleteは足し算ですが、FunctorXは掛け算を扱います。Sumpleteについては、以下の記事で知りました。 Gigazine: チャットAI「ChatGPT」を使って開発された実際にプレイ可能なオリジナルパズル「Sumplete」とは?

ChatGPTでゲームを作ることに関しては、次の記事からも影響を受けました。 小鳥ピヨピヨ: たった10分でChatGPTでゲームが作れた

FunctorXの実装

ChatGPTがプログラミングに与える影響について調べたいと考えています。その目的を達成することの一環として、このFunctorXは開発されました。

ChatGPTはいろいろな用途に使えますが、その1つとして、コードを生成することが挙げられます。「WHAT (何を解くか)」を入力としてChatGPTに与えると、「HOW (どう解くか)」が出力されます。このことは、過去80年のコンピュータの歴史を見た時、控え目に表現してもかなりすごいことと言えます。プログラミングという知的作業が大きく変わる可能性があります。

現状では、FunctorXのルールをChatGPTに与えれば、すぐにプレイできる コードが出てくるというわけには行きませんでした。GPT-3.5はそこまで能力が高くないようです。これは3Dプリンタの現状と似ているかもしれません。3Dプリンタより大きなものは作れず、3Dプリンタより大きなものを作ろうとするならば、部品を作って、組み立てるしかありません。同様に、FunctorXを機能ごとに分割し、それぞれに対して、ChatGPTに小さなコードを生成してもらいました。これが部品に相当します。

部品を完成品に組み立てるのは人間の仕事です (もちろんChatGPTにアドバイスをもらいながら、ですが)。ですので、プロのプログラマから見て、「ここは汚ないな」と思う部分は、だいたいの場合、人間が書いている部分です。

FunctorXは、「ChatGPTを使ってどの程度の規模のプログラムができるかを検証すること」の過程から産まれた副産物ではあるものの、お楽しみいただければ幸いです。

米澤 直記