Search found 4 matches

by terance
Sun Nov 23, 2008 2:33 am
Forum: Common Lisp
Topic: Labyrinth:how to find the path?
Replies: 6
Views: 13445

Re: Labyrinth:how to find the path?

Hi to everyone!I have problems with my code:it doesn't detect cycles in the labyrinth...Any ideas about how to detect cycles?
My idea is that when romm meets 2 times in the variable PATH program should write:"Cycle exists!"
by terance
Fri Nov 14, 2008 7:04 am
Forum: Common Lisp
Topic: Labyrinth:how to find the path?
Replies: 6
Views: 13445

Re: Labyrinth:how to find the path?

I've wote something .It's working, but I'd like to know how to re-write this code without using setq ? (defun search_room (point labirint) (cond ((null labirint) nil) ((eql (caar labirint) point) (second (car labirint))) (t (search_room point (cdr labirint))))) (setq way '(in)) (defun search_path (l...
by terance
Sun Nov 09, 2008 9:33 am
Forum: Common Lisp
Topic: Labyrinth:how to find the path?
Replies: 6
Views: 13445

Re: Labyrinth:how to find the exit?

yep you are right ....I need a path ...
Could you explaine how to build from this list:((1 2) (2 4) (IN 1) (IN 3) (1 3) (4 5) (5 OUT)) correct graph?
by terance
Sun Nov 09, 2008 7:43 am
Forum: Common Lisp
Topic: Labyrinth:how to find the path?
Replies: 6
Views: 13445

Labyrinth:how to find the path?

I have a list of the rooms(e.x. ((1 2) (2 4) (IN 1) (IN 3) (1 3) (4 5) (5 OUT)),where () means that rooms are connected with each other "IN"-entrance,"OUT"-exit).Would you be so kind to explaine the algorithm ,which can find the exit ?