Re: 2 TADS questions
15 Jun 1995 08:36:41 GMT
Dan Shiovitz <scythe@u.washington.edu> wrote:
> I think a better way to do it (I've since changed my method, but it's
> messier), is
>
> o := length(self.location.contents);
> for (i := 1; i < o; ++i)
> if (cantake self.location.contents[1])
> self.location.contents[1].moveInto(self);
This fails if any of the calls to cantake fails (the loop spends the
rest of its time attempting and failing to move the first item in the
list).
--
Gareth Rees