|
|
|
|
|
by exDM69
5025 days ago
|
|
I suggested using Prolog in the comments. His problem description was not quite good enough for me to assess whether or not Prolog will be a good choice, but at least it's a candidate. A Prolog program is essentially a list of rules that are written as an implication. Something like: moves_to(Cow, Location) :-
hungry(Cow),
current_location(Cow, OldLoc),
food_in(OldLoc, OldFood), food_in(Location, Food),
Food > OldFood.
In human language: a cow moves to a location if it's hungry and there's more food in that location than in current location.I should probably write a proper answer. edit: Added a proper answer to the stackoverflow with an almost complete introductory Prolog example. It's waiting for your upvotes :) |
|