Artificial intelligence ChatGPT OpenAI is able to write a program in BASIC for the Commodore 64?
Try!
In This short video, I recorded the first attempts. I requested two programs in BASIC for the Commodore 64: a FOR cycle and, then, also a more complex programme.
Il risultato è stato ottimo, anche se ho riscontrato un paio di errori nel programma più complesso: il gioco "sasso, carta, forbice". La scelta del secondo programma ("sasso, carta, forbice") è stata a discrezione dell'intelligenza artificiale Chat GPT-3.
We repeat the experiment: we ask for programs in basic artificial intelligence
From the ChatGPT main page, we request a BASIC program for the Commodore 64, which contains a FOR loop. Although I request the program using the English language, you can also use your native language.

To learn how to use ChatGPT, you can refer to this article.

The program listing is as follows, very simple.
10 FOR I = 1 TO 10 20 PRINT I 30 NEXT I 40 END
In itself, the program works well and has no problems. Riga 40 is superfluous, given that the program would end equally, even without education END. Let's see the execution of the program onVICE emulator for Commodore 64.

Programma in BASIC: "sasso, carta, forbice"
Per complicare un po' la vita all'intelligenza artificiale Chat GPT di Open AI, ho richiesto un programma più complesso. Il primo tentativo, è quello che abbiamo visto nel video breve. Non funzionava immediatamente. Successivamente, ho riprovato a chiedere il programma del gioco "sasso, carta, forbice". In questo caso, il programma funziona senza problemi.

The program listing is as follows:
10 PRINT "ROCK, PAPER, SCISSORS!" 20 INPUT "YOUR CHOICE (R/P/S)"; A$ 30 IF A$ = "R" THEN PRINT "ROCK": GOTO 60 40 IF A$ = "P" THEN PRINT "PAPER": GOTO 60 50 IF A$ = "S" THEN PRINT "SCISSORS": GOTO 60 55 PRINT "INVALID CHOICE, TRY AGAIN" 56 GOTO 20 60 REM Computer's choice 70 B = INT(RND(1)*3) 80 IF B = 0 THEN PRINT "COMPUTER CHOSE ROCK" 90 IF B = 1 THEN PRINT "COMPUTER CHOSE PAPER" 100 IF B = 2 THEN PRINT "COMPUTER CHOSE SCISSORS" 110 REM Determine the winner 120 IF A$ = "R" AND B = 0 THEN PRINT "TIE": GOTO 150 130 IF A$ = "R" AND B = 1 THEN PRINT "COMPUTER WINS": GOTO 150 140 IF A$ = "R" AND B = 2 THEN PRINT "YOU WIN": GOTO 150 150 IF A$ = "P" AND B = 0 THEN PRINT "YOU WIN": GOTO 180 160 IF A$ = "P" AND B = 1 THEN PRINT "TIE": GOTO 180 170 IF A$ = "P" AND B = 2 THEN PRINT "COMPUTER WINS": GOTO 180 180 IF A$ = "S" AND B = 0 THEN PRINT "COMPUTER WINS": GOTO 210 190 IF A$ = "S" AND B = 1 THEN PRINT "YOU WIN": GOTO 210 200 IF A$ = "S" AND B = 2 THEN PRINT "TIE": GOTO 210 210 END
The program is very interesting, also because it was completely generated by artificial intelligence. What will programmers be used for in the future?
Apart from the consideration already made relating to education END, the command is missing to reset the random numbers generator. This command was in the first version of the program, seen in the short video. He was wrong, but there was. In this second version, it is missing.
Let's see the execution of the program onVICE emulator for Commodore 64.

Did you like these artificial intelligence experiments paired with the Commodore 64? For more content, you can subscribe to the YouTube channel and activate the notification bell.
Related articles:

Kung Fu Flash update

Commodore PET CBM 8032 keyboard repair

Ctrl+Alt Museum

solder Soldering Tutorial, Commodore MP32C64

BBS anni '80 e '90… ai giorni d’oggi

RGB - SCART Video Adapter for Commodore Amiga

MIDI music with Atari Mega ST

Adjust the Commodore 1541 with Speed Test by Zibri

Si stava meglio negli anni '80 oppure oggi?

Disassembling and cleaning the IBM 8513 monitor

Complete list of Commodore PET Basic V4.0 commands

Tutorial: how to build a XUM1541

Sticky Plastic: How to Clean and Remove Deteriorated Rubber Coating

Commodore 64 Vs modern PC?

Basic Programming Course, # 1

Commodore 128D 100% NOT tested, does it work?

The history of the Commodore 64 written by ChatGPT

