Colossal Cave Adventure in batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Colossal Cave Adventure in batch

#16 Post by foxidrive » 27 Oct 2013 20:53

dbenham wrote:I've posted version 1.4 to my Google site. It has significant bug fixes to the end game.


The link is in the top post here.

kevin
Posts: 2
Joined: 30 Oct 2013 03:27

Re: Colossal Cave Adventure in batch

#17 Post by kevin » 30 Oct 2013 03:59

... when I quit, the console printed my score and something else and then exited without letting me read it. ...

I notice the program has been changed to accomodate this by adding a "pause" on (about) line 1702, just before the "exit /b".

If you want the program to pause (or not) on exit, depending on how the program was started, here is a small change to automatically do that...

For version 1.4: At line 1702:
Find the pause command

Replace it with:
echo %cmdcmdline%|find /i "%~dp0"&&pause"
-or-
echo %cmdcmdline%|find /i "%~dp0"&&timeout /t 6
-or-
set "exitdelay=6"
echo %cmdcmdline%|find /i "%~dp0"&&timeout /t %exitdelay%


With this change...

If the program is started "directly" from within a command prompt window, the program will Not pause when the program exits. You will simply be returned to the command prompt.

Otherwise, if the program is started by clicking a shortcut or clicking the ".bat" file from within Windows Explorer or from the deskop, the program Will pause when the program exits.

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Colossal Cave Adventure in batch

#18 Post by dbenham » 30 Oct 2013 21:23

Good idea. I've updated the link at the opening post to point to version 1.5

You forgot to redirect output to nul, and I used %~f0 instead of %~dp0

Code: Select all

echo %cmdcmdline%|find /i "%~f0">nul&&pause


Dave Benham

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Colossal Cave Adventure in batch

#19 Post by dbenham » 29 Mar 2014 10:09

I've moved the game download from my Google Site to my DropBox to make it easier to maintain. And I published the link using Google's URL Shortener so that I can get a crude measure of how many people have downloaded the game. I only wish I had done this sooner. I suspect there may already have been hundreds of downloads.

The game is available at http://goo.gl/2ohAxB


Dave Benham

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Colossal Cave Adventure in batch

#20 Post by dbenham » 27 Mar 2015 19:11

I've updated the code to version 1.6 (same link).

I fixed a bug with pit fall detection that was reported by John Rausch. The old code was making it a bit too easy to fall in and die.

I also fixed a minor long standing bug in the travel options while within the building. The bug was in the original FORTRAN source code that I coded from, and I suspect it may have been in the original.


Dave Benham

captain batch file
Posts: 2
Joined: 19 Feb 2021 10:51

Re: Colossal Cave Adventure in batch

#21 Post by captain batch file » 19 Feb 2021 11:02

Hi dbenham,
Wanted to say thank you greatly for this project & all your amazing work within the forever challenging & vodoo science of msdos :)

miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Re: Colossal Cave Adventure in batch

#22 Post by miskox » 22 Feb 2021 05:38

I just downloaded it and tried it. Question: how do I redisplay the inormation I get when entering a new place? If I enter many commands the information disappaers from the screen.

Thanks.
Saso

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Colossal Cave Adventure in batch

#23 Post by dbenham » 22 Feb 2021 12:44

Enter the command "look"

I think there may be a bug of sorts. I believe the original Don Woods version of the game always gave the full description every time you enter a "room", unless you issue the command "brief". After issuing "brief", you only get the full description the first time you enter a room, and you get a short place name on subsequent visits. The "brief" command informs you of the "look" command to get the full description.

Besides getting instructions at the beginning, you can use "help" to get some additional information, as well as "info" to get even more info. The "info" text implies that "brief" actually serves a purpose.

In this version, the game starts out as if you already entered the "brief" command. So the "brief" command serves no purpose. This was the behavior of the Fortran code that I based this batch version on.

The text is nearly 100% the same as the original Don Woods version. Unlike the Fortran code I used as a source, I changed the text in some places to account for differences from the original behavior. But I missed this issue.


Dave Benham

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Re: Colossal Cave Adventure in batch

#24 Post by dbenham » 22 Feb 2021 15:48

I misremembered a bit.

By default (behavior at start), the full location is given the first time you enter a room, and every 5th time you enter the room after that.

If you use "look" (or "descr" for describe), then the long description will be prefaced with "Sorry, but I am not allowed to give more detail. I will repeat the long description of your location."

After you use "brief", you will never get the long description unless you specifically use "look", and then the long description is no longer prefaced with the "Sorry" message.

So I guess the Help and Info text should not be modified after all. Everything is as it should be. :)


Dave Benham

miskox
Posts: 630
Joined: 28 Jun 2010 03:46

Re: Colossal Cave Adventure in batch

#25 Post by miskox » 23 Feb 2021 01:15

Dave, thank you. I will check it.

In the ZX Spectrum days there were lots of text adventures but I was never into them... Maybe you could port legendary 'The Hobbit'...if there is a source.

Saso

Post Reply