[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The 1st Annual 1-2K Text Adventure Competition



"Scott Julian" <Scott.Julian@alphaworks.com.au> wrote in message
news:vNcEc.70095$sj4.55051@news-server.bigpond.net.au...
> I can't speak on behalf of Paul but its just a challenge to see
what people
> can come up with. Although having a second competition with an
increase
> memory size of 8k, 16k or more would be great.
>
> Scott.
>
>
>
> "Rich" <richward@despammed.com> wrote in message
> news:vak2e0hm1n0p1d6sbf72lfsg2eetsv1tka@4ax.com...
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi
> >
> > Why only 1 to 2k?  No good adventure with a decent story can be
made
> > in that small a memory print.  Why not say 48 - 64k  At least
then
> > there can be a story line.
> >
> > Rich
> >

Well, it's ages since I tried to  write *anything* in BASIC, but I
managed to find a copy of QBASIC and lash up the following (1,851
bytes of source code):

10 R$ = "You are chained to a bench in a cave, watching shadows on
the wall. "

20 C$ = "The chains don't look very strong. ": C = 0

25 C1$ = "You are chained to the bench; you can't move. "

30 S$ = "The shadows don't seem very real. "

40 B$ = "It's just a plain wooden bench. "

45 W$ = "The wall is rough, with shadows cast on it. "

46 RR$ = "IN A CAVE" + CHR$(10) + CHR$(10)

50 CLS : PRINT RR$; R$

60 INPUT ">", z$

70 GOSUB 100: PRINT : GOTO 60

100 z$ = LCASE$(z$): i$ = LEFT$(z$, 1)

110 IF i$ = "q" THEN PRINT "Thanks for playing!": END

120 IF i$ = "l" THEN PRINT RR$; R$: RETURN

130 IF i$ = "b" AND INSTR(z$, "chain") THEN GOSUB 1000: RETURN

135 IF LEFT$(z$, 3) = "exa" THEN i$ = "x"

140 IF i$ = "x" AND INSTR(z$, "chain") THEN PRINT C$: RETURN

150 IF i$ = "x" AND INSTR(z$, "shadow") THEN PRINT S$: RETURN

160 IF i$ = "x" AND INSTR(z$, "wall") THEN PRINT W$: RETURN

170 IF i$ = "x" AND INSTR(z$, "cave") THEN PRINT R$: RETURN

180 IF i$ = "x" AND INSTR(z$, "bench") THEN PRINT B$: RETURN

185 IF LEFT$(z$, 3) = "go " THEN i$ = MID$(z$, 4, 1)

190 IF i$ = "e" OR i$ = "n" OR i$ = "w" THEN GOSUB 2000: RETURN

200 IF i$ = "s" THEN GOSUB 2100: RETURN


900 PRINT "I don't understand": RETURN

1000 IF C = 0 THEN PRINT "You break the chain and stand up. ": C =
1: C$ = "The chains are broken. " ELSE PRINT C$

1010 IF C = 1 THEN R$ = "You are standing in a cave, with an exit to
the south." + CHR$(10) + "Shadows flicker on the north wall. "

1020 RETURN

2000 IF C = 0 THEN PRINT C1$ ELSE PRINT "You can't go that way. "

2010 RETURN


2100 IF C = 0 THEN PRINT C1$: RETURN

2110 PRINT "You walk out of the cave into the sunlight"

2115 PRINT "and discover that there's a real world out there!"

2120 PRINT "You have been liberated from the world of illusion!":
PRINT

2130 PRINT "*** YOU HAVE WON *** "

2140 END


The "parser" (if it can be called that) is *extremely* primitive and
will probably produce quite bizarre responses to unanticipated
commands, but at least it responds correctly to the anticipated
ones!

-- Eric