Terminator — 17 of 33

Matt Weiner

Release 0

Section 5 - Carried Items

Every turn (this is the update the coordinates of carried items rule):

update the coordinates of carried items.

[and we'll also do this after setting the world up.]

To update the coordinates of carried items:

repeat with item running through things: [I think this may actually be faster than looping over things carried by a robot, or even portable things]

if item is carried by a robot (called bot):

now the x-coordinate of item is the x-coordinate of bot;

now the y-coordinate of item is the y-coordinate of bot.

[This means that when a robot drops something the coordinates of the dropped item are automagically the coordinates where it was dropped and stay that way.

Oh, and all those "In the planet" calls for determining visibiility catch dropped items but not carried ones (because of what's directly in the room, which is nice because I did not plan that.]