Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Kangaroo problem, np complete :)
#1
This was originally a 10th grade maths extra credit problem. I made a computer program to solve it and display the kangaroo steps recently.

Can you solve it and/or make a program that shows each step? Smile

Here it is, the Kangaroo Problem (I rewrote it from memory)
Code:
'The point of this program is to solve
'the Kangaroo Problem, defined as follows:

'There are N kangaroos crossing a bridge from both sides.
'(so 2N kangaroos total)
'
'They need to get to their respective other sides.
'The only problem is that the bridge is so narrow
'that they can only move forward and not sideways.
'
'At first the kangaroos line up like this: >>>_<<< (n = 3)
'They need to line up like this:           <<<_>>>
'
'Kangaroos can HOP and JUMP.
'A kangaroo HOP moves the Kangaroo forward one space: >_ to _>
'A kangaroo JUMP moves the Kangaroo forward two spaces: ><_ to >_>
'
'How to HOP and JUMP the kangaroos to the other side?
'(two kangaroos can't occupy one space!)
'HINT Try to solve the problems with small N's first!
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Messages In This Thread
Kangaroo problem, np complete :) - by Agamemnus - 08-02-2003, 10:58 PM
Kangaroo problem, np complete :) - by xhantt - 08-03-2003, 12:32 AM
kangaroo problem - by SCM - 08-04-2003, 06:15 AM
Kangaroo problem, np complete :) - by na_th_an - 08-04-2003, 07:18 AM
kangaroo challenge - by SCM - 08-05-2003, 03:09 AM
Re: kangaroo challenge - by Phydaux - 08-05-2003, 06:04 AM
Kangaroo problem, np complete :) - by Agamemnus - 08-05-2003, 07:20 PM
Kangaroo problem, np complete :) - by Lanzaa - 08-06-2003, 02:46 AM
Kangaroo problem - by SCM - 08-06-2003, 11:20 AM
Kangaroo problem, np complete :) - by Agamemnus - 08-09-2003, 04:51 AM
Kangaroo problem, np complete :) - by Lanzaa - 10-03-2003, 06:01 AM
Kangaroo problem, np complete :) - by Agamemnus - 10-03-2003, 06:17 AM
Kangaroo problem, np complete :) - by Lanzaa - 10-03-2003, 06:41 AM
Kangaroo problem, np complete :) - by Agamemnus - 10-03-2003, 06:47 AM
Kangaroo problem - by SCM - 10-03-2003, 07:31 AM
Kangaroo problem, np complete :) - by Lanzaa - 10-03-2003, 07:57 AM
Kangaroo problem, np complete :) - by SCM - 10-03-2003, 08:10 AM
Kangaroo problem, np complete :) - by Lanzaa - 10-03-2003, 08:19 AM
Kangaroo problem, np complete :) - by SCM - 10-03-2003, 11:26 PM
Kangaroo problem, np complete :) - by Agamemnus - 10-04-2003, 03:55 AM
Re: Kangaroo problem, np complete :) - by Clippy - 07-12-2009, 01:05 AM
Re: Kangaroo problem, np complete :) - by LPG - 10-30-2009, 08:21 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)