[Haskell-cafe] Re: Newbie: Project: Missionary and Cannibal

Paul Johnson paul at cogito.org.uk
Tue Jan 16 14:54:16 EST 2007


This is presumably your homework.  See 
http://www.haskell.org/haskellwiki/Homework_help

This kind of problem is often solved by using the List monad, so try 
looking at that first.

Failing that, have a list of moves to make a sequence.  Then make a list 
of all possible sequences.  Then filter out the ones that break the 
rules.  Whatever is left is the answer you want.

Paul.


More information about the Haskell-Cafe mailing list