M
mehul
Dear all..
I am trying to find a way to graphically represent the following
puzzle... I will really appreciate it, if I can be provided with a JAVA
code for the following:
Farmer, chicken,fox and corn are one side of the river. They have a
boat on which at one time only one other person can ride along with the
farmer and cross the river.
However, the problem lies in the following:
If the farmer leaves the chicken and the fox together, fox eats the
chicken.
If the farmer leaves the chicken and the corn togethet, chcken eats the
corn.
I think loops,boolean and conditional statements would do the job.
Thanks a lot..
Mehul
I am trying to find a way to graphically represent the following
puzzle... I will really appreciate it, if I can be provided with a JAVA
code for the following:
Farmer, chicken,fox and corn are one side of the river. They have a
boat on which at one time only one other person can ride along with the
farmer and cross the river.
However, the problem lies in the following:
If the farmer leaves the chicken and the fox together, fox eats the
chicken.
If the farmer leaves the chicken and the corn togethet, chcken eats the
corn.
I think loops,boolean and conditional statements would do the job.
Thanks a lot..
Mehul