Entrapment

Developer(s): Wayne DeJulia
Date: 1982
Type: Program
Platform(s): ZX81, TS 1000
Tags: Game

A trapping game for 16K. Your inverse star leaves a trail as it moves; steer it with I (up), M (down), J (left) and K (right), and with no key pressed it keeps moving right. The computer’s player does the same. Run into a trail and you lose; trap the computer and you win. After YOU WIN or YOU LOSE the game starts again.

The playing field is kept in memory above address 30000, so it needs 16K.

Published in Syntax August 1982 (Entrapment).

Related Articles

This game pits you against your computer.

Image Gallery

Source Code

  50 CLEAR
  55 CLS
  60 LET B=30000
  69 FAST
  70 FOR L=2 TO 19
  71 FOR M=2 TO 30
  72 POKE B+L*40+M,CODE (" ")
  73 NEXT M
  74 NEXT L
  80 RAND
 110 FOR N=1 TO 31
 120 PRINT AT 21,N;"▞"
 130 PRINT AT 1,N;"▞"
 140 POKE B+21*40+N,CODE ("▞")
 150 POKE B+1*40+N,CODE ("▞")
 160 NEXT N
 170 FOR N=1 TO 21
 180 PRINT AT N,1;"▞"
 190 PRINT AT N,31;"▞"
 200 POKE B+N*40+1,CODE ("▞")
 210 POKE B+N*40+31,CODE ("▞")
 220 NEXT N
 225 SLOW
 230 LET A=INT (RND*16+2)
 240 LET C=INT (RND*26+2)
 250 PRINT AT A,C;"+"
 251 POKE B+A*40+C,CODE ("+")
 252 LET D=INT (RND*17+2)
 253 LET E=INT (RND*26+2)
 254 PRINT AT D,E;"*"
 255 POKE B+D*40+E,CODE ("*")
 256 LET M$=INKEY$
 258 IF M$="K" THEN GOTO 510
 259 IF M$="I" THEN GOTO 530
 260 IF M$="M" THEN GOTO 550
 265 IF M$="J" THEN GOTO 490
 266 GOTO 510
 270 LET C=C+1
 272 IF PEEK (B+A*40+C)<>CODE (" ") THEN GOTO 290
 273 PRINT AT A,C;"+"
 275 POKE B+A*40+C,CODE ("+")
 280 GOTO 256
 290 LET C=C-1
 300 LET C=C-1
 305 IF PEEK (B+A*40+C)<>CODE (" ") THEN GOTO 340
 310 PRINT AT A,C;"+"
 320 POKE B+A*40+C,CODE ("+")
 330 GOTO 256
 340 LET C=C+1
 341 LET A=A+1
 344 IF PEEK (B+A*40+C)<>CODE (" ") THEN GOTO 400
 355 PRINT AT A,C;"+"
 360 POKE B+A*40+C,CODE ("+")
 370 GOTO 256
 400 LET A=A-1
 403 LET A=A-1
 405 IF PEEK (B+(A*40)+C)<>CODE (" ") THEN GOTO 450
 410 PRINT AT A,C;"+"
 420 POKE B+(A*40)+C,CODE ("+")
 430 GOTO 256
 450 CLS
 460 PRINT AT 10,10;"YOU WIN"
 461 PAUSE 100
 465 GOTO 50
 490 LET E=E-1
 500 IF PEEK (B+D*40+E)<>CODE (" ") THEN GOTO 700
 501 PRINT AT D,E;"*"
 502 POKE B+D*40+E,CODE ("*")
 503 GOTO 270
 510 LET E=E+1
 520 IF PEEK (B+D*40+E)<>CODE (" ") THEN GOTO 700
 521 POKE B+D*40+E,CODE ("*")
 522 PRINT AT D,E;"*"
 523 GOTO 270
 530 LET D=D-1
 540 IF PEEK (B+D*40+E)<>CODE (" ") THEN GOTO 700
 541 POKE B+D*40+E,CODE ("*")
 545 PRINT AT D,E;"*"
 547 GOTO 270
 550 LET D=D+1
 560 IF PEEK (B+D*40+E)<>CODE (" ") THEN GOTO 700
 565 POKE B+D*40+E,CODE ("*")
 570 PRINT AT D,E;"*"
 575 GOTO 270
 700 CLS
 705 PRINT AT 10,12;"YOU LOSE"
 715 PAUSE 100
 720 GOTO 50

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