Answer to Question #247731 in Prolog for Ilyass

Question #247731

This homework is about finding a path in a labyrinth modelled as ann×n-grid of white and blackcells. Suppose a robot starts in the upper lefthand corner and wants to move to the lower righthandcorner. It can move horizontally and vertically (but not diagonally), and it can only move via whitecells. In Prolog, we represent the grid as a list of lists of the atomsw(forwhite) andb(forblack).We store the grid given to us using the predicate grid/1.


We represent cells as terms of the formX/Yand we represent the current state as the cell at whichthe robot currently is located. First implement a predicate calledwhite/1that you can use to checkwhether a given cellX/Yis white. Then implement a predicatemove/2which generates all legalfollow-up states for a given state, when used with enforced backtracking.


1
Expert's answer
2021-10-08T11:52:17-0400
Dear Ilyass, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS