日本語

Programming language PG0

Programming with AI

How to ask an AI to make PG0 programs for you. Nothing complicated: you just tell the AI what you want.

What can it do?

PG0 has a "door" for AIs (an API). Through this door an AI can:

Write a program

It writes a PG0 program that does what you asked for.

Test it

It runs the program itself and fixes mistakes.

Save it online

It saves the finished program and gives you a URL (link) to open it.

All you do is open the URL the AI gives you. The program opens in this editor, where you can run it, look at it and change it yourself.

What you need

No money, no sign-upThe PG0 door (API) is free for everyone.

How to use it (3 steps)

  1. Ask the AI. Copy one of the examples below, change it to what you want, and send it to the AI.
  2. The AI writes, tests and saves. It reads the PG0 guide, writes the program, runs it to make sure it works, and saves it online. When it is done it gives you a URL.
  3. Open the URL and run it. The editor opens; press the ▶ button. If you want something changed, ask the AI (Asking for changes).

You can also find saved programs by name or genre with "Open online" in the editor menu.

Examples of what to ask

Always include the URL of the PG0 guide in your message. The AI reads it to learn how PG0 works. Replace the parts in "( )" with your own words.

An ordinary program

Please make a program in PG0.5.
First read https://pg0.jp/api/agent/v1/manual?lang=en to learn how PG0 works.
What I want: show all the prime numbers from 1 to 100.
When it is done, run it to make sure it works, then save it online.
Name it "Prime finder", author "(your name)", password "(a word you choose)", genre "math".
Finally give me the URL to open it.

A game

Please make a breakout game in PG0.5 that I can play by touching the screen.
First read https://pg0.jp/api/agent/v1/manual?lang=en to learn how PG0 and its screen work.
When it is done, save it online with execution speed "No wait".
Name it "Breakout", author "(your name)", password "(a word you choose)", genre "game".
Finally give me the URL that opens and starts the game right away.

A quiz

Please make a multiplication quiz in PG0.5.
First read https://pg0.jp/api/agent/v1/manual?lang=en.
Ask random questions; when I type an answer, tell me if it is right. Stop after 10 questions.
Save it online as "Times table quiz", author "(your name)", password "(a word you choose)", genre "study", and give me the URL.

Asking for changes

To have a saved program changed, give the AI the program ID and the password. The ID is the long string after cid= in the URL.

Please change the program with ID (the string after cid= in the URL). The password is "(your word)".
Make the ball get faster over time.
When you save it, write what you changed in the memo.

Changes are kept in the "Revision history". If you liked the old version better, you can open it from "Revision history" in the editor menu.

Rules for names and passwords

Making games

When something goes wrong

What happensWhat to do
The AI says it does not know PG0Check that your message contains the guide URL (https://pg0.jp/api/agent/v1/manual?lang=en) and tell the AI to read that page first.
"The name is already taken"Ask for another name.
"Wrong password"Give the AI the password you used when saving.
The program never stopsTell the AI to check for an endless loop and fix it.
It works, but not the way you wantedTell the AI exactly what is different, for example "stop after 10 rounds" or "make the text bigger".

Want to know more?

The guide the AI reads can be read by people too. It explains how PG0 is written and the details of the AI door (API).