Using <tt>not</tt> to find the cheapest goods


next up previous
Next: Searching for regions
Up: Traveller
Previous: Gateways
Back: to main list of student notes

Using not to find the cheapest goods

Having found and corrected the error in gateway, have a look at nearest_gateway, below. The idea is that nearest_gateway(From,Region,Gateway) is true if Gateway is that gateway to Region which is nearest to From. It could be used by a trader who has started off some way from a particular region, and who wants to move into that region before starting to trade.

Translate the definition into English. There is a bug in it (one I committed myself when writing the game); what is it?

Now, one can write a structurally similar predicate for finding the cheapest wholesaler. Call it cheapest_seller_in_region(Good,Region,Square). It is true when Square offers the lowest price of any square selling Good within Region. Define it!

You will find the answers in TRADER..


next up previous
Next: Searching for regions
Up: Traveller
Previous: Gateways
Back: to main list of student notes



Jocelyn Paine
Tue Jun 4 18:14:46 BST 1996