Code Comments
Programming Forum and web based access to our favorite programming groups.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
Post Follow-up to this messagenope 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
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.