A 10-line TurboBASIC XL program for the Atari 8-bit computer
Written for 2014 NOMAM programming competition

Bill Kendrick, February 24, 2014

An entry for the NOMAM 2014 10-line TurboBASIC XL game competition.


This is a tiny game in which you dig around underground (not unlike Dig-Dug) and collect diamonds, while avoiding falling diamonds or boulders (like Boulder Dash).

Use a joystick in port 1 to play. Move around within the dirt to collect the diamonds. As you move, the dirt goes away. You cannot pass through bricks or boulders.

When all diamonds have been collected, you receive a bonus and are advanced to the next level. If the bonus timer runs out before you've collected all the diamonds (which might happen if the diamonds are trapped), you get no bonus, and move on to the next level.

If there's nothing underneath a boulder or diamond, it will fall (it may take a moment before it starts falling). If it lands on you, you lose a life and return to the top of the screen. Note that you may hold a diamond or boulder up by standing beneath it before it falls — this includes walking past, or even stopping directly below, a diamond or boulder that had something else underneath it (dirt, a boulder, or a diamond) that you removed.

If there's nothing next to a boulder, you may push it aside from the left or right.

When you run out of lives, the game ends. You'll have a few moments to review your score and the level you progressed to, and the game will reset at level 1.


...coming soon...

It was developed for the NOMAM 2014 competition.

Line-by-line Breakdown of the Source Code


10 GRAPHICS 18:V=3:SC=DPEEK(88):DIM F$(40),Z$(4):F$="{...}":CH=(PEEK(106)-16)*256:Z=194

20 MOVE 57344,CH,1024:MOVE ADR(F$),CH+8,40:POKE 756,CH/256:P=P+B:B=100:FOR X=1 TO 10:POKE SC+X,Z:POKE SC+X*20,Z:POKE SC+X+220,Z

Level Init

30 POKE SC+X*20+11,Z:Z$="{inv ctrl d}{inv ctrl d}{inv B}{ctrl e}":FOR Y=1 TO 10:POKE SC+Y*20+X,3:NEXT Y:NEXT X:L=L+1:Q=0:FOR I=0 TO L*4:SZ=SC+RAND(9)+1+(RAND(8)+2)*20 40 C=ASC(Z$(RAND(4)+1)):IF PEEK(SZ)=3:POKE SZ,C:IF C=132:Q=Q+1:ENDIF :ENDIF :NEXT I:Y=1:X=4

Main Loop

100 SZ=SC+Y*20+X:POKE SZ,65:GOSUB 200:SOUND 0,0,0,0:S=STICK(0):IF S<>15:XM=0:OX=X:OY=Y:POKE SZ,0:IF S=7:XM=1:ENDIF :IF S=11:XM=-1 110 ENDIF :X=X+XM:IF S=13:Y=Y+1:ENDIF :IF S=14:Y=Y-1:ENDIF :SZ=SC+Y*20+X:C=PEEK(SZ):CC=PEEK(SZ+XM):IF C=194:X=OX:Y=OY:ENDIF 120 IF C=5:IF CC=0:POKE SZ,0:POKE SZ+XM,5:ELSE :X=OX:Y=OY:ENDIF :ENDIF :IF C=132:P=P+1:SOUND 0,255-(Q*10) MOD 255,10,10:Q=Q-1:ENDIF :ENDIF 130 IF V=0:PAUSE Z:RUN :ENDIF :POSITION 12,0:? #6;"{ctrl a}";V;"{inv ctrl c}";L:POSITION 12,1:? #6;"B";B;" ":POSITION 12,2:? #6;"{inv $}";P:B=B-SGN(B):GOTO 100-(Q*B=0)*80

Falling object subroutine

200 YY=YY+1:IF YY>10:YY=0:W=1-W:ENDIF :FOR XX=1+W TO 10 STEP 2:SS=SC+YY*20+XX:C=PEEK(SS):IF (C=5 OR C=132) AND PEEK(SS+20)=0 210 POKE SS+20,C:POKE SS,0:IF YY+2=Y AND XX=X:SOUND 0,200,4,10:PAUSE 5:POKE SS+40,0:Y=1:X=4:V=V-1:ENDIF :ENDIF :NEXT XX:RETURN


Bill Kendrick, 2014,, New Breed Software
Other games I wrote for NOMAM 2014