Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: sbaker8688@xxxxxxx
- Date: Sat, 13 Oct 2007 21:43:59 -0700
This is starting to smell like a homework assignment. If so, we
shouldn't be doing it for you, but we can always give vague tips and
general advice.
I haven't scrutinized your code in detail, but I'm not sure why you
can't easily enough get around having to manually code up what someone
has. It would seem that if you call current_has() and that person
doesn't have that particular object, the predicate should simply fail
and return "No." Does this natural behavior suit your needs? If not,
call a custom initialization predicate which will initialize things to
zero if current_has() fails. So if current_has(John, tomato, X)
fails, init(John, tomato, 0). I am assuming this would be called from
somewhere in your current_has() predicate, but I could be wrong, so
think about it. Also, you may have to use an if-then type of
structure (I don't know).
Let us know how the project is coming.
.
- Follow-Ups:
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: sbaker8688
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- References:
- Trying to setup a hierarchy of classes of things (SWI prolog)
- From: mearvk
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: bart demoen
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: mearvk
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: sbaker8688
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: sbaker8688
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: sbaker8688
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: Chip Eastham
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: mearvk
- Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- From: mearvk
- Trying to setup a hierarchy of classes of things (SWI prolog)
- Prev by Date: Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- Next by Date: Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- Previous by thread: Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- Next by thread: Re: Trying to setup a hierarchy of classes of things (SWI prolog)
- Index(es):
Relevant Pages
|
|