MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

small puzzle programming


how to code the following puzzle in mathematica programming language:
 the shepherd who want to cross a river aboard a boat taking with him
one of the following items (wolf,sheep,grass) one per time,
 lst ={S,w,g,p}  may describe the group on one side of the river
 lst2={}  may describe the the current state of the other side of the river.
the pairs {{w,p} ,{p,g}} are not allowed
of course the solution is:
((S,p),(S,w),(S,p),(S,g),(S,p))

but how to code this or may be other ideas.

zak


  • Prev by Date: Re: Nonlinear Curve Fitting
  • Next by Date: Simplify problems for checking easy equalities...
  • Previous by thread: why are some functions not listable over packed arrays?
  • Next by thread: Simplify problems for checking easy equalities...