singanetch1
Programmer
I am very new to prolog.
I have a problem for which the coding should be written in Prolog with Depth
First Search Algorithm. The question is;
" there are 2 sand clocks. One could measure only 5 minutes and the other one only 7 minutes.
How can i measure 13 minutes with the use of only these two clocks?"
The attachment shows the sequence of actions needed to achieve this task.
But I don't understand how to define the problem in prolog domain( facts and
the rules needed)
I have to write a program that should output the goal path in the following
format.
A- clock 5
b- clock 7
output
------
1) turn A & B
2) once A is finish turn A
3) once B is finish turn B
4) once A is finish turn B
Please help me with this problem with a example. Thanks in advance for your
time and consideration.
thank you
mj
I have a problem for which the coding should be written in Prolog with Depth
First Search Algorithm. The question is;
" there are 2 sand clocks. One could measure only 5 minutes and the other one only 7 minutes.
How can i measure 13 minutes with the use of only these two clocks?"
The attachment shows the sequence of actions needed to achieve this task.
But I don't understand how to define the problem in prolog domain( facts and
the rules needed)
I have to write a program that should output the goal path in the following
format.
A- clock 5
b- clock 7
output
------
1) turn A & B
2) once A is finish turn A
3) once B is finish turn B
4) once A is finish turn B
Please help me with this problem with a example. Thanks in advance for your
time and consideration.
thank you
mj