Defuse

See all articles from SYNC v1 n5
Drawing of a robot with a bomb detector
Drawing of a robot with a bomb detector

You are the Chief of Security in a major government building. You have just received a telephone message from a terrorist group claiming that they have planted a bomb somewhere in the building. Fortunately, you have the most sophisticated electronic detection equipment available. Your detector gives off a signal that gets stronger as you get closer to the bomb. However, the building is large—100 stories high, 100 rooms long, and 100 rooms wide—and you are pressing a time limit of 200 seconds to find the bomb and defuse it.

Starting at the bottom (0, 0, 0), you enter the coordinates of each room you want to test (length, width, height) in response to the reading from your detector.

This program was adapted to the ZX80 and to fit into 1K of RAM from More Basic Computer Games published by Creative Computing.

Defuse Program Listing

 10 RANDOMISE
20 LET A=RND(99)
30 LET B=RND(99)
40 LET C=RND(99)
50 LET D=0
60 LET E=0
70 LET F=0
80 LET S=0
90 CLS
100 PRINT "#L###W####H####SECONDS##SIGNAL"
110 PRINT
120 LET L=PEEK(16421) (current line on screen)
130 IF L<22 THEN INPUT D
140 IF D<10 THEN PRINT "#";
150 PRINT D;
160 IF L<22 THEN INPUT E
170 IF E<10 THEN PRINT "#";
180 PRINT "##";E;
190 IF L<22 THEN INPUT F
200 IF F<10 THEN PRINT "#";
210 PRINT "##";F,S,10000-(ABS(A-D)+ABS(B-E)
+ABS(C-F))*29
220 IF A=D AND B=E AND C=F THEN GO TO 270
230 IF S=200 THEN GO TO 310
240 IF L<4 THEN GO TO 90 (prevent screen overflow)
250 LET S=S+10
260 GO TO 110
270 CLS
280 PRINT
290 PRINT "BOMB DEFUSED AT ";S;" SECONDS"
300 GO TO 360
310 CLS
320 PRINT
330 PRINT "BOOOMMM THE BUILDING BLEW UP"
340 PRINT
350 PRINT "THE BOMB WAS AT ";A;",";B;",";C
360 PRINT
370 PRINT "PLAY AGAIN?"
380 INPUT A$
390 IF CODE(A$)=62 THEN RUN

Sample Run

 L   W   H   Seconds   Signal
 0   0   0      0       6636
40   0   0     10       6636
20  40   0     20       8376
20  60   0     30       8434
20  52   0     40       8666
20  56   0     50       8550
20  50   0     60       8666
20  51  16     70       9159
20  51  30     80       9565
20  51  46     90       9971
20  51  45
-------------------------------
BOMB DEFUSED AT 100 SECONDS
PLAY AGAIN?
"N"

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.