I'm completely new to Prolog and working on a homework assignment My program is supposed to solve flow free problem using depth first, I don't need the whole code for it as its what supposed to do but I need to know how to think to solve it or what parts it will contain.
the points look like that:
dot('R',[3,1],[0,3]).
so this 2 points is red and suppose to connect them
so I was thinking that there will be moves to move from 1 point to another and already it works
move([R,C],[NR,NC]):-
move_right(R,C,NR,NC).
move([R,C],[NR,NC]):-
move_Left(R,C,NR,NC).
move([R,C],[NR,NC]):-
move_Up(R,C,NR,NC).
move([R,C],[NR,NC]):-
move_Down(R,C,NR,NC).
I think now I need to think about the start and the goal so the start is initial grid which contain points with there colors and they all are not connected so I need to take element from start for example red point and find all paths between the 2 points by using moves then for each element I will have multiple paths so what should I do and is there a goal which I will stop for it ?
May be the question is confusing but really don't know how to solve it specially when trying to
get useful from backtracking.
All I need to know that I need for example a function to take something and return another something and so on, without its implementation and I will do that