In the caves world (file DD), assume that each player has his or her own score:
The idea is that this would initially be zero for each player, and would increase with kills, as players wipe out their enemies (how they might do this was described in Supplement 5).
Write and test a predicate called gain(P,N)
where P is the name
of a player and N is a number. gain
must add N to P's score. Thus,
gain(fred,20).
would up Fred's score from 23 to 43, deleting the old
clause for score
and adding a new one. We will use this in the next
supplement which considers how you might write a complete Adventure
game.