Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2007

Tip: Looking for answers? Try searching our database.

Help with brain puzzle

Thread view: 
spinolaangelo@gmail.com - 23 May 2007 12:10 GMT
Hello,

Does anyone have the old puzzle called Misionaries and Canibals for
more than 3 Canibals and 3 Misionaries, for 4 C and 4 M and for 5 C
and 5 M. How can this be done? Are there more than one solutions in
Java? What is the easiest and smartest way to do it?

Thanks for the help
kind regards
Andrew Thompson - 23 May 2007 13:04 GMT
...
>Does anyone have the old puzzle called Misionaries and Canibals for
>more than 3 Canibals and 3 Misionaries, for 4 C and 4 M and for 5 C
>and 5 M. How can this be done? ..

Do you have homework?  

>..Are there more than one solutions in Java?

Feeling lazy?

> ..What is the easiest and smartest way to do it?

Trying to get folks on this usenet newsgroup to do it?

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Christian - 23 May 2007 13:46 GMT
spinolaangelo@gmail.com schrieb:
> Hello,
>
[quoted text clipped - 5 lines]
> Thanks for the help
> kind regards

I would recommend you breadth first search in the tree of possible
moves... he problem space is really small so you shouldn't get any
problmes with that algorithm..

the rest is your homework...

Christian
spinolaangelo@gmail.com - 23 May 2007 16:25 GMT
What algoritm?

> spinolaang...@gmail.com schrieb:
>
[quoted text clipped - 15 lines]
>
> Christian
spinolaangelo@gmail.com - 23 May 2007 16:25 GMT
What algoritm?

> spinolaang...@gmail.com schrieb:
>
[quoted text clipped - 15 lines]
>
> Christian
spinolaangelo@gmail.com - 23 May 2007 16:27 GMT
What algoritm?

> spinolaang...@gmail.com schrieb:
>
[quoted text clipped - 15 lines]
>
> Christian
spinolaangelo@gmail.com - 23 May 2007 16:28 GMT
What algoritm?

> spinolaang...@gmail.com schrieb:
>
[quoted text clipped - 15 lines]
>
> Christian
Lew - 23 May 2007 16:44 GMT
> What algoritm?

Please do not top-post (place replies above the material quoted), but place
your comments in line with the text to which you're responding.

The algorithm of which Christian wrote you quoted in your reply:
>> breadth first search in the tree of possible moves

Google on "breadth-first" (vs. "depth-first") searches.

GIYF.

Signature

Lew

Hendrik Maryns - 24 May 2007 11:38 GMT
spinolaangelo@gmail.com schreef:
> Hello,
>
> Does anyone have the old puzzle called Misionaries and Canibals for
> more than 3 Canibals and 3 Misionaries, for 4 C and 4 M and for 5 C
> and 5 M. How can this be done? Are there more than one solutions in
> Java? What is the easiest and smartest way to do it?

Have a look at the book ‘Geometrie mit Taxis, die Köpfe der Hydra und
andere mathematische Spielereien’.  That is the German title, but it is
translated from English.

H.
- --
Hendrik Maryns
http://tcl.sfs.uni-tuebingen.de/~hendrik/
==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
Gordon Beaton - 24 May 2007 11:55 GMT
> Does anyone have the old puzzle called Misionaries and Canibals for
> more than 3 Canibals and 3 Misionaries, for 4 C and 4 M and for 5 C
> and 5 M. How can this be done? Are there more than one solutions in
> Java? What is the easiest and smartest way to do it?

http://www.google.com/search?q=%22generate+and+test%22

/gordon

--


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.