12.07.2015 Views

Logik und Logische Programmierung Einführung

Logik und Logische Programmierung Einführung

Logik und Logische Programmierung Einführung

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Labyrinth!sol(T) :- ls(T),sol(T,1,1).!sol([],4,6).!sol([right|T],R,C) :- go_right(R,C), C1 is C+1, sol(T,R,C1).!sol([left|T],R,C) :- C1 is C-1, go_right(R,C1), sol(T,R,C1).!sol([down|T],R,C) :- go_down(R,C), R1 is R+1, sol(T,R1,C).!sol([up|T],R,C) :- R1 is R-1, go_down(R1,C), sol(T,R1,C).!ls([]).!ls([_|T]) :- ls(T).!

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!