With the rise of LLM systems (or “AI” as they are annoyingly called), the term “vibe coding” is all the rage recently. Vibe coding is when you rely almost entirely on these “AI” system to write your code for you via a series of drawn-out conversations.
Putting on my cranky old man hat, I find most of it rather frustrating. Now I’m not some retro-sycophant who refuses to use modern tools. I’ve been a software professional for over 30 years at this point and I’ve used lots of tools throughout the years. Many that were cool and hip have long since disappeared or fallen out of fashion. I’ve also actually used these AI systems myself to help figure out some code. I find they function really well as a better search engine for documentation and can also serve as a way to “rubber duck” ideas and get some outlines. Any code I get back rarely seems to work as-is, but it often can provide ideas for something I hadn’t considered or perhaps point out something I did not know about.
After all, today’s technology is complex and it is not always easy to find what you need in the documentation.
But how does vibe coding work with something far simpler, such as the simplest programming language of them all: BASIC?
I suspect this might be a little tricker than it first appears. First of all, usage of BASIC largely predates the internet so there is far less BASIC code out there for LLMs to learn from. Many online retro BASIC books and docs are often scanned copies rather than easily digested plain text. Also, BASIC is not a single language, but more of an umbrella term for a family of languages all of which have the same “vibe”1, but often very different commands and capabilities, some of which rely heavily on PEEKs and POKEs to really take advantage of their system’s features2. And those ancient forms of API calls are poorly documented online.
So this should be an interesting challenge and to make it even slightly trickier, I’m going to use Atari BASIC rather than a much more common Microsoft BASIC variant, such as AppleSoft. Why? Because this is an Atari newsletter and I have plenty of Atari equipment to test things with. Alas, I don’t have any Apple II-era systems.
With that said, I will be using the Atari800MacX emulator because it makes it easy to paste in the generated code.
Now with all that out of the way, which LLM AI system should we try? Considering ChatGPT is the most commonly known and one most are familiar with, that’s I’m using for this experiment, although Anthropic Claude is also great for use with coding.
To do proper vibe coding, I need to refrain from correcting the generated code or even telling the AI what exactly is wrong.
Hello World
So what should be do first? Let’s start with a typical first BASIC program, the precursor to “Hello World”.
Prompt: Please write me a simple program in Atari BASIC that repeatedly prints “Hello, World” to the screen.
ChatGPT aced this simple test. I have to say, I do love seeing “GOTO 10” like that!
Draw a Circle
Atari BASIC does not have a built-in way to draw a circle so let’s ask for that:
Prompt: Write me an Atari BASIC program that draws a blue circle in graphics mode 7.
So far, the vibes are flowing. This program ran perfectly, although it only drew a rough, dotted circle.
I asked it for a solid outline instead of a dotted outline and it came back with this code:
10 GRAPHICS 7
20 COLOR 1
30 X=80:Y=48:R=30
40 A=0
50 X1=X+R*COS(A)
60 Y1=Y+R*SIN(A)
70 FOR A=0 TO 6.28 STEP .05
80 X2=X+R*COS(A)
90 Y2=Y+R*SIN(A)
100 DRAWTO X2,Y2
110 X1=X2:Y1=Y2
120 NEXT A
130 GOTO 130
That drew a solid outline using DRAWTO, but it did not set the starting position correctly.
It was able to fix things, however:
This new code draws correctly:
I then asked it to get rid of the blue bar at the bottom and it did that admirably by using GRAPHICS 7+16.
That all went well!
Create a Drawing Program
Continuing the graphics theme, let’s take it up a notch. Atari BASIC does have built-in commands for drawing lines and accessing the joystick, which are more than enough to make a simple drawing program.
Prompt: Write an Atari BASIC program that lets you draw on the screen using a joystick. It should use graphics mode 7 and allow you to rotate between colors by pressing the fire button.
The resulting code had several errors:
To use COLOR as a variable name, LET is required. The “;” is not used for comments in any version of BASIC I’ve ever seen.
Prompt: Line 30 shows this error: ERROR- COLOR=1. There are also errors on any lines that use ";" for a comment.
It fixed these errors by changing COLOR to just C and getting rid of most comments:
10 GRAPHICS 7+16
20 X=80:Y=48
30 C=1
40 POKE 77,0
50 REM === MAIN LOOP ===
60 ST=STICK(0)
70 BT=STRIG(0)
80 IF ST=11 THEN Y=Y-1
90 IF ST=7 THEN Y=Y+1
100 IF ST=13 THEN X=X-1
110 IF ST=14 THEN X=X+1
120 IF X<0 THEN X=0
130 IF X>159 THEN X=159
140 IF Y<0 THEN Y=0
150 IF Y>95 THEN Y=95
160 IF BT=0 THEN GOSUB 200
170 COLOR C
180 PLOT X,Y
190 GOTO 60
200 REM === CYCLE COLORS ===
210 C=C+1
220 IF C>3 THEN C=1
230 FOR D=1 TO 20:NEXT D
240 RETURN
That code ran fine, but the joystick directions were wrong. Joystick up draws right; down draws left; left draws up; right draws down.
After telling it about the joystick problem, it fixed it to this:
10 GRAPHICS 7+16
20 X=80:Y=48
30 C=1
40 POKE 77,0
50 REM === MAIN LOOP ===
60 ST=STICK(0)
70 BT=STRIG(0)
80 IF ST=14 OR ST=10 OR ST=6 THEN Y=Y-1 : REM UP
90 IF ST=13 OR ST=9 OR ST=5 THEN Y=Y+1 : REM DOWN
100 IF ST=11 OR ST=10 OR ST=9 THEN X=X-1 : REM LEFT
110 IF ST=7 OR ST=6 OR ST=5 THEN X=X+1 : REM RIGHT
120 IF X<0 THEN X=0
130 IF X>159 THEN X=159
140 IF Y<0 THEN Y=0
150 IF Y>95 THEN Y=95
160 IF BT=0 THEN GOSUB 200
170 COLOR C
180 PLOT X,Y
190 GOTO 60
200 REM === CYCLE COLORS ===
210 C=C+1
220 IF C>3 THEN C=1
230 FOR D=1 TO 20:NEXT D
240 RETURN
The resulting program works fine, although I don’t think line 40 is needed:
Create a Game
How about a simple game? Using sprites (player/missiles) in Atari BASIC requires a machine language subroutine, so that’s probably not realistic. Other types of games use a redefined character set which only require some PEEKs and POKEs. We can ask ChatGTP to make a rudimentary version of Space Invaders this way and that seems worth a try. With the game being so well known, hopefully I don’t need to provide a ton of prompting.
Prompt: Create a simple version of Space Invaders using Atari BASIC. Use a large text graphics mode with a redefined character set for the aliens, spaceship and missiles. The player’s ship should be controlled with the joystick.
It’s first response was rather simple:
10 GOSUB 1000 :REM Setup custom characters
20 GRAPHICS 0
30 POKE 77,0 :REM Disable cursor
40 DIM AL$(5)
50 FOR I=0 TO 4:AL$(I)="A":NEXT I
60 FOR I=0 TO 4:POKE 752+I*2,ASC(AL$(I)):NEXT I
70 SHIPX=20 :MISSILE=0 :MX=0 :MY=0 :C=0
80 FOR I=5 TO 35 STEP 6
90 POSITION I,5 :PRINT "A"; :NEXT I
100 REM === MAIN LOOP ===
110 ST=STICK(0) :BT=STRIG(0)
120 IF ST=11 AND SHIPX>0 THEN SHIPX=SHIPX-1
130 IF ST=7 AND SHIPX<38 THEN SHIPX=SHIPX+1
140 POSITION 0,22 :PRINT " "
150 POSITION SHIPX,22 :PRINT "S";
160 IF MISSILE=0 AND BT=0 THEN MISSILE=1 :MX=SHIPX :MY=21
170 IF MISSILE=1 THEN
180 POSITION MX,MY :PRINT "|";
190 FOR T=1 TO 100:NEXT T
200 POSITION MX,MY :PRINT " ";
210 MY=MY-1
220 IF MY<0 THEN MISSILE=0:GOTO 240
230 POSITION MX,MY :IF PEEK(PEEK(88)+MX+MY*40)=ASC("A") THEN POSITION MX,MY:PRINT " ";:MISSILE=0
240 END IF
250 GOTO 100
1000 REM === CUSTOM CHARACTER SET ===
1010 CHB=57344 :REM RAM for new charset
1020 FOR I=0 TO 1023
1030 POKE CHB+I,PEEK( CHB+I ) :REM Copy original
1040 NEXT I
1050 POKE 756,CHB/2048 :REM Point to new set
1060 RETURN
The MISSILE variable name causes a syntax error, as does the use of “END IF”.
After I pointed out those errors, it came back with this:
10 GRAPHICS 0
20 POKE 77,0 :REM Disable cursor
30 DIM AL$(5)
40 SHIPX=20 :FIRE=0 :MX=0 :MY=0
50 FOR I=5 TO 35 STEP 6
60 POSITION I,5 :PRINT "A"; :NEXT I
100 REM === MAIN LOOP ===
110 ST=STICK(0) :BT=STRIG(0)
120 IF ST=11 AND SHIPX>0 THEN SHIPX=SHIPX-1
130 IF ST=7 AND SHIPX<38 THEN SHIPX=SHIPX+1
140 POSITION 0,22 :PRINT " "
150 POSITION SHIPX,22 :PRINT "S";
160 IF FIRE=0 AND BT=0 THEN FIRE=1 :MX=SHIPX :MY=21
170 IF FIRE=1 THEN GOSUB 300
180 GOTO 100
300 REM === MOVE MISSILE ===
310 POSITION MX,MY :PRINT "|";
320 FOR T=1 TO 75:NEXT T
330 POSITION MX,MY :PRINT " ";
340 MY=MY-1
350 IF MY<0 THEN FIRE=0 :RETURN
360 POSITION MX,MY
370 IF PEEK(PEEK(88)+MX+MY*40)=ASC("A") THEN POSITION MX,MY :PRINT " " :FIRE=0 :RETURN
380 RETURN
That code did run without any errors, but it didn’t really work. There was a ton of flicker and the aliens scrolled off the top of the screen. Moving the ship and firing did work, though.
I then suggested that it try to use Graphics 1 and that it not redefine any characters and instead use “A” for alien, “S” for ship and a vertical bar for the missile.
The code that came back ran OK, but it was still using Graphics 0.
10 GRAPHICS 1+16
20 POKE 77,0 :REM Disable cursor
30 SHIPX=10 :FIRE=0 :MX=0 :MY=0
40 REM === DRAW ALIEN ROW ===
50 FOR I=2 TO 18 STEP 3
60 POSITION I,5 :PRINT "A"; :NEXT I
100 REM === MAIN LOOP ===
110 ST=STICK(0) :BT=STRIG(0)
120 IF ST=11 AND SHIPX>0 THEN SHIPX=SHIPX-1
130 IF ST=7 AND SHIPX<19 THEN SHIPX=SHIPX+1
140 POSITION 0,22 :PRINT " "
150 POSITION SHIPX,22 :PRINT "S";
160 IF FIRE=0 AND BT=0 THEN FIRE=1 :MX=SHIPX :MY=21
170 IF FIRE=1 THEN GOSUB 300
180 GOTO 100
300 REM === MOVE MISSILE ===
310 POSITION MX,MY :PRINT "|";
320 FOR D=1 TO 50:NEXT D
330 POSITION MX,MY :PRINT " ";
340 MY=MY-1
350 IF MY<0 THEN FIRE=0 :RETURN
360 POSITION MX,MY
370 IF PEEK(PEEK(88)+MX+MY*20)=ASC("A") THEN POSITION MX,MY :PRINT " " :FIRE=0 :RETURN
380 RETURN
That is because it is using PRINT instead of PRINT #6. I told ChatGPT that it was still using Graphics 0, but it was not able to fix it on its first revision.
I again told it that it was still running in Graphics 0 to see if it might figure it out. But it did not figure it out, instead going off on a tangent about screen memory and character sets, neither of which were relevant.
I decide to tell it what was wrong: The problem is that you are using PRINT instead of PRINT #6;. You don't need to alter memory or character sets. Please try again.
It came back with better code, but it took several back-and-forths before it came back with code that actually ran. And even then it later crashed with an ERROR 141, Cursor out of range because it was using INPUT #6, which doesn’t make sense here.
Instead it really should use LOCATE to check for a collision with an alien ship.
Frankly, this vibe coding was exhausting and I gave up trying to coerce ChatGPT into getting this working. I think ChatGPT gave me a reasonable program outline, but the back-and-forth was just tedious! I certainly could have fine-tuned things faster.
So I did. Here is the working code for this simple game:
10 GRAPHICS 1+16
20 POKE 77,0:REM Turn off text cursor
30 SHIPX=10:FIRE=0:MX=0:MY=0
40 REM === DRAW ALIEN ROW ===
50 FOR I=2 TO 18 STEP 3
60 POSITION I,5:PRINT #6;"a";:NEXT I
100 REM === MAIN LOOP ===
110 ST=STICK(0):BT=STRIG(0)
120 IF ST=11 AND SHIPX>0 THEN SHIPX=SHIPX-1
130 IF ST=7 AND SHIPX<19 THEN SHIPX=SHIPX+1
140 POSITION 0,22:PRINT #6;" ";
150 POSITION SHIPX,22:PRINT #6;"S";
160 IF FIRE=0 AND BT=0 THEN FIRE=1:MX=SHIPX:MY=18
170 IF FIRE=1 THEN GOSUB 300
180 GOTO 100
300 REM === MOVE MISSILE ===
310 LOCATE MX,MY,C
315 POSITION MX,MY:PRINT #6;"."
320 FOR D=1 TO 50:NEXT D
330 POSITION MX,MY:PRINT #6;" ";
340 MY=MY-1
350 IF MY<0 THEN FIRE=0:RETURN
355 IF C<>32 THEN S=S+10:FIRE=0
370 POSITION 0,0:PRINT #6;S
390 RETURN
There’s not all that much here. You can use the joystick to move the “S” ship left/right at the bottom. Press fire to shoot a “.” as the missile. If you hit an “A” alien then you get 10 points. The aliens don’t move. As I said, it’s rather simple.
As simple as this is, I’m really not sure how someone that doesn’t know Atari BASIC would be able to get it working at all doing just vibe coding with ChatGPT, which would constantly go back to writing incorrect code. Even when I knew something was wrong and corrected it, it didn’t always seem to help much. It feels like you’d hit an endless loop of back-and-forth prompts that won’t ever work properly.
As I mentioned at the beginning perhaps this is more useful with modern languages, but I’d say with an old-school BASIC, vibe coding was ultimately a bust.
This just might be the word of the year!
Looking at you, Commodore 64.
If vibe coding had existed back in the 8-bit computer days, I would be ruling the planet by now. Okay, maybe not the entire planet, but I would have had a nice duchy somewhere. I’m sure that’s true. It has to be.
Besides the problem of results often being wrong and not working, if you are proficient in Google-Fu, you can usually find better examples to teach you what you are trying to learn. Eventually, these tools will improve, but at what cost to the original poster of quality examples and tutorials? If people quit posting because they never get the credit and recognition they deserve, there will be a point where "AI" hits a wall.