10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Discussion, Reviews & High-scores

Moderator: Moderators

Post Reply
jcompton
Vic 20 Newbie
Posts: 17
Joined: Mon Jun 19, 2006 12:45 pm

10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by jcompton »

Today's episode of 8-Bit Show and Tell features Robin Harbron porting an amazing 10-line BASIC text adventure from the ZX81 to the VIC-20. (It's also been verified to run on C64 and PET 2001). Also making a guest appearance is a port of the game to the Infocom ZIL language, where it's shown running on C64 Ozmoo and VIC-20 BitShifter interpreters.

https://www.youtube.com/watch?v=_d2g5BXdyfU
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: 10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by Kweepa »

Pretty cool!
Seems kind of like cheating since it's so hard coded, but I guess what can you do in 10 lines? Seeded random map?
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: 10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by Kweepa »

I had a go at implementing it in Scott Adams style (with an action table). It still fits in 10 lines:

Code: Select all

0 o(2)=4:o(3)=3:o(5)=2:l=1:dAcave,hall,pit,lake,key,corpse,chest,sword,dragon
1 reS:fOi=1to4:rEr$(i):nE:?:?"you are in a ";r$(l)
2 fOi=1to5:rEa$:n$(i)=" "+a$:nE:fOi=1to5:ifo(i)=ltH?"you see a";n$(i)
3 nE:inputa$:fOi=1to15:rEv$,n,r,f,h,s$,y,o,p,c,d,q:m$=v$+n$(n)
4 ifm$=a$aNl=raN(faNg)=htHl=l+y:g=g orc:g=gaNnO(d):i=20:ifo>0tHo(o)=p
5 nE:?s$:ifq=0tH1:dAnorth,9,1,,,ok,1,,,,,,east,9,2,,,ok,1,,,,,,south,9,2,,,ok,-1,,,,,
6 dAnorth,9,3,,,ok,1,,,,,,west,9,3,,,ok,-1,,,,,,south,9,4,,,ok,-1,,,,,
7 dAkill,5,2,8,8,you win,,,,,,1,kill,5,2,,,you die,,,,,,1,search,2,4,1,,a key,,1,4,1,,
8 dAtake,1,4,3,1,taken,,1,,2,,,open,3,3,6,2,a sword,,4,3,4,,,open,3,3,6,,locked,,,,,,
9 dAtake,4,3,12,4,taken,,4,,8,,,open,3,3,8,8,empty,,,,,,,x,1,,,,no way,,,,,,
Note 1: the format of the action table is: verb,noun,room,flags mask,flag match,message,move offset,object to move,room to put object,flags to add,flags to remove,quit.
Note 2: the data statements would need to be shuffled around to fit on C64 (since some lines are >80 columns) but it's doable. I decided on keeping it this way as it's more readable.
jcompton
Vic 20 Newbie
Posts: 17
Joined: Mon Jun 19, 2006 12:45 pm

Re: 10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by jcompton »

Neat to see a different take on the same concept! It plays very well.

The substantial difference I note between this and the others is that unless I've missed something, you can't inspect your inventory. Correct?
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: 10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by Kweepa »

Ah, oops. Here's a slightly uglier version with an inventory. :)

Code: Select all

0 o(2)=4:o(3)=3:o(5)=2:l=1:dAcave,hall,pit,lake,key,corpse,chest,sword,dragon
1 reS:fOi=1to4:rEr$(i):nE:?:?"you are in a ";r$(l):fOi=1to5:rEa$:n$(i)=" "+a$
2 ifo(i)=ltH?"you see a";n$(i):dAnorth,9,1,,,ok,1,,,,,,east,9,2,,,ok,1,,,,,
3 nE:inputa$:ifa$="inventory"tHfOi=1to5:?n$(i-5*(o(i)<>6));:nE:?:goto1
4 fOi=1to15:rEv$,n,r,f,h,s$,y,o,p,c,d,q:m$=v$+n$(n):dAsouth,9,2,,,ok,-1,,,,,
5 ifm$=a$aNl=raN(faNg)=htHl=l+y:g=g orc:g=gaNnO(d):i=20:ifo>0tHo(o)=p
6 nE:?s$:ifq=0tH1:dAnorth,9,3,,,ok,1,,,,,,west,9,3,,,ok,-1,,,,,,south,9,4,,,ok,-1,,,,,
7 dAkill,5,2,8,8,you win,,,,,,1,kill,5,2,,,you die,,,,,,1,search,2,4,1,,a key,,1,4,1,,
8 dAtake,1,4,3,1,taken,,1,6,2,,,open,3,3,6,2,a sword,,4,3,4,,,open,3,3,6,,locked,,,,,,
9 dAtake,4,3,12,4,taken,,4,6,8,,,open,3,3,8,8,empty,,,,,,,x,1,,,,no way,,,,,,
jcompton
Vic 20 Newbie
Posts: 17
Joined: Mon Jun 19, 2006 12:45 pm

Re: 10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by jcompton »

Nicely amended!

Do I need to counter with a port to the new Dialog language? :)
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: 10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by Kweepa »

i say go for it!
jcompton
Vic 20 Newbie
Posts: 17
Joined: Mon Jun 19, 2006 12:45 pm

Re: 10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by jcompton »

Even better (because it's still 10 lines of BASIC and still an 8-bit machine and didn't require me to do any work) someone else ported it to BBC BASIC today!

https://t.co/GXta77Gw3f
User avatar
Kweepa
Vic 20 Scientist
Posts: 1315
Joined: Fri Jan 04, 2008 5:11 pm
Location: Austin, Texas
Occupation: Game maker

Re: 10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by Kweepa »

That Beeb site is amazing. Thanks!!!
Tamurello
Vic 20 Newbie
Posts: 13
Joined: Fri May 31, 2019 2:17 pm
Location: Germany
Occupation: Freak

Re: 10 CAVE ADVENTURE on VIC-20 (and other CBM BASIC computers)

Post by Tamurello »

Stunt Car Racer on the BBC? Hell...
Post Reply