Hey John,
Cool game! Not bad for AI with human feedback loop. :)
I made a minor change so it is less "blinky", see attached. Lines 120,
290 and 300. This change does the following:
Stop erasing (i.e. printing a space) at the current player and monster
positions before the calcuation loop.
Erase monster by printing SPACE; MONSTER; SPACE at a location one space
to the left of the monster location
Track old player position and then erase player and redraw him at the
same time to delay time between updates.
Hope it is okat that I didn't use AI for this :)
Ken
On 12/23/25 11:32 PM, John R. Hogerhuis wrote:
So I was inspired to play with Gemini Pro and generate a little game
for the Model 100. I get Gemini Pro usage for free as a student since
I take woodworking classes at a local community college.
The first two levels kind of work. It took a lot of iterating. It
cannot actually do its own testing in gemini, so it generates the code
blind with no testing and throws it over the wall to SQA/me (like a
real programmer!). Somehow it was generating Model 100 BASIC code
almost off the bat without directly feeding it any manuals. I
eventually fed it the quick reference guide.
One bad problem it had through several iterations was that it didn't
know only the first two characters of variable names were significant.
So it was controlling different things with the same variable.
Teaching that fixed a lot of frustrating jank and if I realized it it
probably would have take far less time to get it to this point.
The idea is that you pick up gems and a key. When you get the key the
portal opens and you can go to the next level.
Kind of fun. I didn't have to write any code at all. I only had to
look at the code to see why it seemed unable to fix reported bugs, and
that was a failure to understand our version of BASIC.
-- John.
10 REM --- GEM HUNTER V8.0 ---
15 CLEAR 3000: ON ERROR GOTO 900
20 CLS: PRINT "READY!": SCREEN 0,0: CALL 16959
60 DIM A$(3), B$(3), GX(3), GY(3), GV(3)
65 CU=1: SC=0: E$=" ": F$=STRING$(40,132)
70 K1=0: PX=5: PY=6: VY=0: JG=0: FR=147: MF=144
72 TX=38: TY=6: KX=34: KP=2
75 IF CU=1 THEN M1=15: Y1=4: M2=25: Y2=2: D1=1: D2=-1
76 IF CU=2 THEN M1=10: Y1=4: M2=20: Y2=2: D1=1: D2=1
80 GOSUB 1000: GOSUB 2000: GOSUB 3000: GOSUB 4000
110 REM --- MAIN LOOP ---
120 OY=PY:OX=PX
135 IF K1=0 AND M2<>KX AND KP<4 THEN PRINT @ KP*40+KX,CHR$(213);
140 M1=M1+D1: IF CU=1 AND (M1>24 OR M1<6) THEN D1=-D1
146 IF CU=2 AND (M1>25 OR M1<6) THEN D1=-D1
150 M2=M2+D2: IF CU=1 AND (M2>34 OR M2<16) THEN D2=-D2
151 IF CU=2 AND (M2>30 OR M2<10) THEN D2=-D2
160 IF MF=144 THEN MF=145 ELSE MF=144
170 VY=VY+0.6: IF VY>1.2 THEN VY=1.2
180 NY=PY+VY: IF NY>6 THEN NY=6: VY=0: JG=0
185 IF NY<0 THEN NY=0: VY=0
190 Y=INT(NY): IF Y<4 THEN M$=A$(CU): Z=Y ELSE M$=B$(CU): Z=Y-4
205 IF Z<0 THEN Z=0
210 C$=MID$(M$,(Z*40)+PX+1,1): IF C$=" " THEN 215
214 NY=PY: VY=0: JG=0
215 PY=INT(NY): K$=INKEY$: IF K$="" THEN 230
220 IF K$<>"" THEN FR=295-FR
230 IF K$=CHR$(28) THEN NX=PX+1 ELSE IF K$=CHR$(29) THEN NX=PX-1 ELSE NX=PX
240 IF NX=TX AND PY=TY AND K1=0 THEN SOUND 12000,2: NX=PX: GOTO 250
242 IF NX=TX AND PY=TY AND K1=1 THEN 600
245 IF NX<2 OR NX>38 THEN NX=PX
246 PX=NX
250 IF K$=CHR$(30) AND JG=0 THEN VY=-2.2: JG=1: SOUND 5000,2
267 IF PX=KX AND PY=KP AND K1=0 THEN K1=1: SOUND 1000,5: GOSUB 4000
290 PRINT @ Y1*40+M1-1," "CHR$(MF)" ";: PRINT @ Y2*40+M2-1," "CHR$(MF)" ";
295 PRINT @ TY*40+TX,CHR$(134+K1);
300 PRINT @ OY*40+OX," ";:PRINT @ PY*40+PX,CHR$(FR);
310 IF (PX=M1 AND PY=Y1) OR (PX=M2 AND PY=Y2) THEN 500
320 FOR I=1 TO 3: IF PX=GX(I) AND PY=GY(I) AND GV(I)=1 THEN GV(I)=0: SC=SC+10:
SOUND 800,3: GOSUB 4000
322 NEXT I
330 FOR T=1 TO 5: NEXT T: GOTO 120
500 CLS: PRINT "CAUGHT!": SOUND 15000,10: GOTO 70
600 REM --- VICTORY & NEXT LEVEL ---
605 CLS: PRINT "LEVEL";CU;"COMPLETE!": RESTORE 700
610 FOR I=1 TO 16: READ P,L: SOUND P,L: NEXT I
615 CU=CU+1: IF CU>3 THEN 950
616 IF CU=2 THEN KX=5: KP=3: TX=38: TY=6
620 GOTO 70
700 DATA
2092,10,2092,10,1864,10,1567,10,1567,10,1864,10,2092,10,2348,10,2636,10,2636,10,2348,10,2092,10,2092,10,2348,10,2348,10,2636,25
900 REM --- ERROR HANDLER ---
905 ER=ERR: IF ER=5 THEN 950: REM IGNORE CTRL-C FC ERROR
910 CLS: PRINT "ERROR:";ER: IF ER=9 THEN PRINT "BS: BAD SUBSCRIPT"
920 IF ER=13 THEN PRINT "TM: TYPE MISMATCH"
930 IF ER=14 THEN PRINT "OS: OUT OF STRING SPACE"
950 CALL 16964: SCREEN 0,1: END
1000 FOR N=1 TO 3: A$(N)=E$+E$+E$+E$: B$(N)=E$+E$+E$+F$: NEXT N
1016 MID$(B$(1),46,20)=STRING$(20,132): MID$(A$(1),136,20)=STRING$(20,132)
1025 MID$(B$(2),46,20)=STRING$(20,132): MID$(A$(2),136,20)=STRING$(20,132)
1040 RETURN
2000 CLS: PRINT @ 0,A$(CU);: PRINT @ 160,B$(CU);: RETURN
3000 FOR I=1 TO 3: GX(I)=5*I+10: GY(I)=6: GV(I)=1: NEXT I: RETURN
4000 PRINT @ 1," ";: IF K1=0 THEN IF KP<4 THEN PRINT @ KP*40+KX,CHR$(213)
4010 IF K1=1 THEN PRINT @ 2,"[K]";
4020 FOR I=1 TO 3: IF GV(I)=1 THEN PRINT @ GY(I)*40+GX(I),CHR$(151);
4030 NEXT I: RETURN