Labyrinth in prolog

2

I'm a big programming enthusiast and I have a little problem that I can not think of anymore.

The situation is this: I set out to make a program in Prolog that is capable of getting out of a maze.

I have researched a lot on the internet, but I did not get much success, I would like some indication of material or tip to get me the solution. Here's what I can pull out of the material I read:

start:-
      Li=1,
      Ci=1,
      Lf=6,
      Cf=8,
      lab(La),
      imprime(La),
      tenta(Li, Ci, Lf, Cf, La).

  lab(La):-
      La =(" ############",
           " #i         #",
           " # # # #### #",
           " #   # # #  #",
           " # # #   # ##",
           " # # # ######",
           " #   #  #f  #",
           " # #### ### #",
           " # #      # #",
           " # ###### # #",
           " #   #      #",
           " ############",

  tenta(Li, Ci, Lf, Cf, La):-
      tentaright().

  tenta(Li, Ci, Lf, Cf, La):-
      tentadown().

  tenta(Li, Ci, Lf, Cf, La):-
      tentaleft().

  tenta(Li, Ci, Lf, Cf, La):-
      tentaup().

  resolve():-
      tenta(Li, Ci, Lf, Cf, La),
      resolve().

PS: The indentation may be a bit strange, but it's because my development environment has numbering on the sides and I've taken it out here to be more aesthetic to post.

    
asked by anonymous 25.10.2017 / 02:59

0 answers