Colossal Cave Adventure in batch

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Message
Author
foxidrive
Expert
Posts: 6033
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: 2369
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: 2369
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: 2369
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

Post Reply