This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Programming Diversions and the fly likes A simple  puzzle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "A simple  puzzle" Watch "A simple  puzzle" New topic
Author

A simple puzzle

Lizette Donelly
Greenhorn

Joined: Nov 19, 2003
Posts: 7
A king has 9 soldiers on each side of his castle, doing guard duty.
@@@ @@@ @@@

@@@ castle @@@
@@@ @@@ @@@
Part 1:
War breaks out, and he needs 4 of these men to go fight. He still wants 9 men guarding him on each side, with men in the centre and sides positions as originally. How does he do it with the remaining men?
Part 2:
They win the war, and the 4 men came back to guard duty. But for safety reasons he wants an additional 4 men guarding him. He still wants only 9 on each side etc. etc. (as part 1), but with the four additional men added to the original amount of men. How does he organize the men?
Jessica Sant
Sheriff

Joined: Oct 17, 2001
Posts: 4313

Unfortunately HTML is disabled in this forum, so I can't hide my answer in the same color font as the background.... SO... if you don't wanna see my solution, don't scroll down!!!
blah
blah
blah
blah
ok -- here it is:
9 on each side, 20 men total

9 on each side, 28 men total:

[ November 20, 2003: Message edited by: Jessica Sant ]

- Jess
Blog:KnitClimbJava | Twitter: jsant | Ravelry: wingedsheep
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: A simple puzzle