For Programmers: Free Programming Magazines  


Home > Archive > Prolog > December 2004 > I need help









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author I need help
nope

2004-12-19, 3:56 am

Hello

I hope someone can help me with this problem. I've got facts:

room(room1).
room(room2).
room(room3).
room(room4).
etc.

door(room1, room2).
door(room1, room3).
door(room1, room4).
door(room3, room4).
etc.

location(thing_a, room1).
location(thing_b, room2).
etc.

start(room1).

And I've to write a predicate move/1 witch locates a thing and moves
it to the start. I've written a similar program (like Nani search),
where I can walk around the rooms and move things but how can I make
the program to to the same? :)

Thanks,
Risto

Cesar Rabak

2004-12-20, 3:58 pm

nope escreveu:
> Hello
>
> I hope someone can help me with this problem. I've got facts:

[Nani search like snippet cut out]

> And I've to write a predicate move/1 witch locates a thing and moves
> it to the start. I've written a similar program (like Nani search),
> where I can walk around the rooms and move things but how can I make
> the program to to the same? :)
>

From the perfunctory information you gave, it may be your instructor
expects you make use of some concept [s]he might just have discussed.

Otherwise, you'll have to figure out Prolog to do an extensive search
from start to the room that has the thing and do the walk you already
know how.

--
Cesar Rabak


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com