1K Adventure

Developer(s): David Clark
Date: 1984
Type: Program
Platform(s): ZX81, TS 1000
Tags: Game

A small random-encounter adventure for the ZX81 or TS1000 that fits in 1K. Each turn you find a monster, a potion or treasure. Fight a monster (F) and lose strength, or bribe it (B) with treasure if you have enough; a potion adds strength and treasure adds to your hoard. Strength goes up by 10 each turn; the game ends when it reaches zero and tells you how many turns you survived.

Press a key after each find to go on. Three corrections were needed for the program to run on a ZX81: lines 100 and 5010 were printed without their closing quotes, and line 50 was printed as LET X=INT +RND*VAL “75”, which the ZX81 rejects (it has no unary plus). The download reads the + as an opening bracket: LET X=INT (RND*VAL “75”). This last correction is a reading of the author’s intent, not printed anywhere.

The Plotter reprinted this program from Sinclair User, the British magazine; the issue is not given.

Published in The Plotter January 1984 (1K Adventure).

Image Gallery

Source Code

   5 REM "1K ADVENTURE"
  10 LET S=VAL "500"
  20 LET T=PI-PI
  30 LET TU=PI/PI
  40 PRINT "TURN ";TU;" TREASURE";T;" STRENGTH ";S
  43 IF S<=0 THEN GOTO 5000
  45 PRINT "YOU HAVE FOUND-"
  50 LET X=INT (RND*VAL "75")
  60 LET H=INT (RND*INT PI)+PI/PI
  65 GOSUB H*100
  70 LET S=S+10
  80 CLS
  90 LET TU=TU+1
  95 GOTO VAL "40"
 100 PRINT "A MONSTER.F/B?"
 110 INPUT I$
 120 IF I$<>"F" AND I$<>"B" OR I$="B" AND T<X THEN GOTO 110
 130 IF I$="F" THEN LET S=S-X
 140 IF I$="B" THEN LET T=T-X
 150 GOSUB 2000
 190 RETURN
 200 PRINT "A POTION"
 210 LET S=S+X
 220 GOSUB VAL "2000"
 230 RETURN
 300 PRINT "TREASURE.IT IS WORTH";X
 310 LET T=T+X
 350 GOSUB VAL "2000"
 400 RETURN
2000 IF INKEY$="" THEN GOTO 2000
2010 RETURN
5000 CLS
5010 PRINT "YOU HAVE DIED.YOU SURVIVED ";TU;" TURNS"

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