08-04-2003, 06:15 AM
Agamemnus,
The solution is fairly straight foreward. Your comment about starting with simple cases is a good general strategy, and worked well for me here. The code took me longer to write than I would like to admit. It would be nice to see some others try this problem, so I am PMing my solution and code to you. Feel free to post them.
Xhantt,
The kangaroos can only move straight forward one space(hop) or two spaces (jump). This all you need to worry about. By moving them one or two spaces, you will either solve the problem or create a road block.
The solution is fairly straight foreward. Your comment about starting with simple cases is a good general strategy, and worked well for me here. The code took me longer to write than I would like to admit. It would be nice to see some others try this problem, so I am PMing my solution and code to you. Feel free to post them.
Xhantt,
The kangaroos can only move straight forward one space(hop) or two spaces (jump). This all you need to worry about. By moving them one or two spaces, you will either solve the problem or create a road block.
hrist Jesus came into the world to save sinners, of whom I am first.(I Timothy 1:15)
For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)
For God so loved the world, that He gave His only begotten Son,
that whoever believes in Him should not perish, but have eternal life.(John 3:16)