A Simplification of Two Commands

One of the things that inevitably occurs over time, is you spot things that could be easier or smoother for the end use the take and drop commands to do so.

The generic use of the take command is:

take name-of-object

So if there is a (say) coin in your current location and you decide to take it with you, you'd use this command:

take coin

To drop the coin once you no longer need it, you'd use this command:

drop coin

It occurred to me that if there is only one object in a location - so there is only one object you can take - issuing the take command without specifying an object should, sensibly, take the only object it can.

take

Likewise, if you're only carrying one object, issuing the command drop on its own ought to drop the only object you're carrying.

drop

I added that functionality into the latest version of TAF. I'm pleased to say, because of the modularity of the code, it took no more than 15 lines of code to achieve.

More from Dave McKay
All posts