Newsgroups: rec.arts.int-fiction
Path: gmd.de!Germany.EU.net!mcsun!uunet!munnari.oz.au!bruce.cs.monash.edu.au!labtam!labtam!philip
From: philip@labtam.labtam.oz.au (Philip Stephens)
Subject: Re: Teleportation? Magic words? Not really! (was: Original Adventure)
Organization: Labtam Australia Pty. Ltd., Melbourne, Australia
Date: Fri, 13 Aug 1993 03:22:45 GMT
Message-ID: <philip.745212165@labtam>
References: <)> <Aug.8.14.32.04.1993.9522@math.rutgers.edu> <)> <243rfrINN62o@life.ai.mit.edu> <1993Aug11.205402.27071@nomina.lu.se> <neilg.745186283@sfu.ca>
Lines: 22

Neil K. Guy writes:

>I'd like to be able to let the player type, say, "Go to the doughnut store."
>The game would then move the player to the doughnut store, incrementing moves
>as necessary.

  A preliminary design for this would be as follows: create a single path
that passes through every room at least once, and meets back at the starting
room.  This could be described as an array of room numbers/pointers/whatever.
Then you'd just need a simple routine to step through this array in order to
find the path to the room you're requesting.  A bit of optimisation would
remove loops and such as you go along so that you get there in the shortest
time possible.
  I did at one stage write an algorithm for this that worked well.  Problem
is, I never implemented it (didn't have a IF language back then :-), and I've
misplaced my notes!  But it shouldn't be hard to figure it out.

-- 
| Philip Stephens, Systems Programmer. | %%%%  %     Labtam Australia Pty Ltd |
| Address:  43 Malcolm Road, Braeside, |   % % % %     "Applied Ingenuity"    |
|           Victoria, 3195, AUSTRALIA. |  %  % %  %  We make the fastest RISC |
| Internet: philip@labtam.labtam.oz.au | %%%%% %%%%% X terminals in the world | 
