The full round already works. Give it an entrance that explains the controls before the ball can move, then check that every way out leads somewhere sensible.
Replace line 10.
Add lines 5000, 5010, 5020, 5030, 5040, 5050, 5060, 5070, 5080, 5090, 5100, 5110, 5120.
10 GO SUB 7000: GO SUB 5000
5000 BORDER 0: PAPER 0: INK 7: CLS
5010 PRINT AT 3,11; INK 5;"BRICK BASH"
5020 PRINT AT 6,3;"One ball. Eighteen bricks."
5030 PRINT AT 9,3;"O left P right"
5040 PRINT AT 11,3;"SPACE serves when ready."
5050 PRINT AT 13,3;"Use the paddle edges to aim."
5060 PRINT AT 15,3;"Clear the wall to finish."
5070 PRINT AT 17,3;"R retries. Q quits."
5080 PRINT AT 20,10; INK 6;"S starts."
5090 LET k$=INKEY$
5100 IF k$="q" OR k$="Q" THEN GO TO 9000
5110 IF k$<>"s" AND k$<>"S" THEN GO TO 5090
5120 RETURNRUN the changed program.
Complete source at this checkpoint
10 GO SUB 7000: GO SUB 5000
100 DIM g(3,6): LET left=18: LET p=14: LET x=127: LET y=40
110 LET dx=4: LET dy=4: LET served=0: LET steps=0
120 FOR r=1 TO 3: FOR c=1 TO 6: LET g(r,c)=1: NEXT c: NEXT r
130 GO SUB 1000: GO SUB 3000
200 LET k$=INKEY$
210 IF k$="q" OR k$="Q" THEN GO TO 9000
220 IF k$="r" OR k$="R" THEN GO TO 100
230 LET oldp=p
240 IF k$="o" OR k$="O" THEN LET p=p-1
250 IF k$="p" OR k$="P" THEN LET p=p+1
260 IF p<2 THEN LET p=2
270 IF p>26 THEN LET p=26
280 IF p<>oldp THEN PRINT AT 18,oldp;" ";AT 18,p; INK 7;p$
290 IF served=1 THEN GO TO 350
300 IF k$=" " THEN LET served=1: PRINT AT 1,2;"Clear every brick. ": GO TO 350
310 IF p=oldp THEN GO TO 200
320 GO SUB 3000: LET x=8 *p+15: GO SUB 3000: GO TO 200
350 LET nx=x+dx: LET ny=y+dy
360 IF nx<16 THEN LET nx=32 -nx: LET dx=ABS dx
370 IF nx>238 THEN LET nx=476 -nx: LET dx=-ABS dx
380 IF ny>149 THEN LET ny=298 -ny: LET dy=-ABS dy
390 IF ny>=32 THEN GO TO 440
400 IF nx+1 <8 *p OR nx>8 *p+31 THEN LET e$="Missed! R for another go.": GO TO 4000
410 LET ny=64 -ny: LET dy=4: LET dx=0
420 IF nx+1 <8 *p+11 THEN LET dx=-4
430 IF nx>8 *p+20 THEN LET dx=4
440 LET tx=nx: LET ty=y: GO SUB 2000
450 IF hit=1 THEN LET dx=-dx: LET nx=x: GO SUB 2500
460 LET tx=nx: LET ty=ny: GO SUB 2000
470 IF hit=1 THEN LET dy=-dy: LET ny=y: GO SUB 2500
480 IF left=0 THEN LET e$="Wall cleared! Nicely done.": GO TO 4000
490 GO SUB 3000
500 LET x=nx: LET y=ny: LET steps=steps+1
510 GO SUB 3000: GO TO 200
1000 BORDER 0: PAPER 0: INK 7: CLS
1010 PRINT AT 0,2; INK 5;"BRICK BASH";AT 0,21; INK 7;"BRICKS 18"
1020 PRINT AT 1,2;"SPACE serves. O/P move."
1030 PLOT INK 1;15,16: DRAW INK 1;0,136: DRAW INK 1;225,0: DRAW INK 1;0,-136
1040 FOR r=1 TO 3: LET inkcol=6
1050 IF r=2 THEN LET inkcol=3
1060 IF r=3 THEN LET inkcol=5
1070 FOR c=1 TO 6: PRINT AT 2+2*r,4*c; INK inkcol;b$: NEXT c: NEXT r
1080 PRINT AT 18,p; INK 7;p$
1090 PRINT AT 21,2; INK 5;"O/P move R retry Q quit";
1100 RETURN
2000 LET hit=0: LET br=1 +INT ((143 -ty)/16): LET bc=1 +INT ((tx+1 -32)/32)
2010 IF br<1 OR br>3 OR bc<1 OR bc>6 THEN RETURN
2020 IF ty+1 <152 -16 *br OR tx>32 *bc+23 THEN RETURN
2030 IF g(br,bc)=0 THEN RETURN
2040 LET hit=1: RETURN
2500 LET g(br,bc)=0: LET left=left-1
2510 PRINT AT 2+2*br,4*bc;" ";AT 0,28; INK 7;left;" "
2520 RETURN
3000 PLOT INK 7; OVER 1;x,y: DRAW INK 7; OVER 1;1,0: DRAW INK 7; OVER 1;0,1: DRAW INK 7; OVER 1;-1,0: RETURN
4000 PRINT AT 1,0;" ";AT 1,2; INK 6;e$
4010 PRINT AT 21,2; INK 7;"R plays again Q quits ";
4020 IF INKEY$<>"" THEN GO TO 4020
4030 LET k$=INKEY$
4040 IF k$="q" OR k$="Q" THEN GO TO 9000
4050 IF k$="r" OR k$="R" THEN GO TO 100
4060 GO TO 4030
5000 BORDER 0: PAPER 0: INK 7: CLS
5010 PRINT AT 3,11; INK 5;"BRICK BASH"
5020 PRINT AT 6,3;"One ball. Eighteen bricks."
5030 PRINT AT 9,3;"O left P right"
5040 PRINT AT 11,3;"SPACE serves when ready."
5050 PRINT AT 13,3;"Use the paddle edges to aim."
5060 PRINT AT 15,3;"Clear the wall to finish."
5070 PRINT AT 17,3;"R retries. Q quits."
5080 PRINT AT 20,10; INK 6;"S starts."
5090 LET k$=INKEY$
5100 IF k$="q" OR k$="Q" THEN GO TO 9000
5110 IF k$<>"s" AND k$<>"S" THEN GO TO 5090
5120 RETURN
7000 RESTORE 7200: FOR j=0 TO 47: READ v: POKE USR "a"+j,v: NEXT j
7010 LET b$=CHR$ 144 +CHR$ 145 +CHR$ 146
7020 LET p$=CHR$ 147 +CHR$ 148 +CHR$ 148 +CHR$ 149: RETURN
7200 DATA 127,255,255,255,255,255,255,127
7210 DATA 255,255,255,255,255,255,255,255
7220 DATA 254,255,255,255,255,255,255,254
7230 DATA 63,127,127,63,0,0,0,0
7240 DATA 255,255,255,255,0,0,0,0
7250 DATA 252,254,254,252,0,0,0,0
9000 PAPER 0: INK 7: PRINT AT 21,0;"Finished. RUN to try again. ";: STOPVisit the instructions once
Line 10 now calls two routines. The first installs the graphics; the second draws the title and waits. S returns from routine 5000, so execution continues at line 100 and creates a new round. Q leaves through the shared exit routine.
The title is drawn with ordinary PRINT AT statements. The lines explain the objective, O/P movement, SPACE serve, paddle aiming, retry and quit. The short messages fit the Spectrum’s 32 character columns.
Retry goes directly to 100, so players do not have to visit the instructions between attempts. The graphics remain installed during that running session, while the round’s mutable state is rebuilt.
Follow the whole cycle
| Situation | What happens next |
|---|---|
| Title | S starts; Q leaves |
| Ready | O/P move the attached ball; SPACE serves |
| Flight | O/P move the paddle while the ball continues |
| Miss or clearance | Movement stops; release the old key, then choose R or Q |
| Retry | Restore all bricks, centre the paddle and wait for a serve |
| Exit | Return to BASIC; RUN begins again at the title |
R and Q also work during ready and flight. They are checked before another candidate move is made.
Reset the round, not just the picture
Line 100 recreates g and restores left, p, x and y. Line 110 restores direction, served and steps. The nested loops mark all eighteen bricks live, then the drawing routine reconstructs their pictures.
This order matters. Drawing eighteen bricks while leaving zeros in g would create decorations the ball could pass through. Resetting g without drawing the wall would create invisible obstacles. The count, state and picture must describe the same round.
Why does retry jump to 100 rather than calling only the drawing routine at 1000?
Show the explanation
The drawing routine changes what we see. It does not reset removed bricks, movement direction or the served flag. Initialisation restores the rules as well as the picture.

Try the awkward exits
Start, serve and retry during flight. Check that the ball returns to its waiting position. Miss while holding a movement key; release it before choosing another attempt. Clear the wall and verify that the ball stops. Retry after that success and check BRICKS 18. Quit from the title, ready state, flight and result, using RUN to start again each time.
The game is deliberately silent. Progress is visible in the disappearing bricks and numeric count, so it does not depend on recognising the row colours. The final instructions say how to aim without needing a sound cue.
If R restores the picture but SPACE does nothing, inspect served at initialisation. If a held key races through a result, check the release loop at 4020. The next lesson keeps this exact program on tape and checks it from a fresh session.
Sources
Steven Vickers, edited by Robin Bradbeer, ZX Spectrum BASIC Programming, second edition (Sinclair Research, 1983), chapters 3–6 and 18.
Run it here
This unit's program, built for you.
- Program
- brick-bash.tap
- Machine
- ZX Spectrum 48K (PAL)