Here is my solution. I suddenly remembered it was in my outbox!! :rotfl:

I also saw a typo... it was "do" instead of "to" in the question....

'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!

'

'

'

'

'ANALYSIS

'An analysis of the problem proceeds in the following fashion:

'Try to solve N = 1 through N = 4 yourself, and look at any patterns emerging.

'You will then be able to extrapolate the general method...

' Try N=1

'>_< 0) they meet 2

'_>< 1) hop one space HOP > ++ 1

'<>_ 2) jump one space JUMP < -- 3

'<_> 3) hop one space: done HOP > ++ 2

' Now try N=2

'>>_<< 0) they meet 3

'>_><< 1) hop one space HOP > ++ 2

'><>_< 2) jump one space JUMP < -- 4

'><><_ 3) hop one space HOP < +- 5

'><_<> 4) jump one space JUMP > -+ 3

'_<><> 5) jump one space JUMP > -+ 1

'<_><> 6) hop one space HOP < +- 2

'<<>_> 7) jump one space JUMP < -- 4

'<<_>> 8) hop one space HOP > ++ 3

' Now try N=3

'>>>_<<< 00) they meet 4

'>>_><<< 01) hop one space HOP > ++ 3 -1

'>><>_<< 02) jump one space JUMP < -- 5 +2

'>><><_< 03) hop one space HOP < +- 6 +1

'>><_<>< 04) jump one space JUMP > -+ 4 -2

'>_<><>< 05) jump one space JUMP > -+ 2 -2

'_><><>< 06) hop one space HOP > ++ 1 -1

'<>_><>< 07) jump one space JUMP < -- 3 +2

'<><>_>< 08) jump one space JUMP < -- 5 +2

'<><><>_ 09) jump one space JUMP < -- 7 +2

'<><><_> 10) hop one space HOP > ++ 6 -1

'<><_<>> 11) jump one space JUMP > -+ 4 -2

'<_<><>> 12) jump one space JUMP > -+ 2 -2

'<<_><>> 13) hop one space HOP < +- 3 +1

'<<<>_>> 14) jump one space JUMP < -- 5 +2

'<<<_>>> 15) hop one space HOP > ++ 4 -1

'ANSWER:

CLS

PRINT : INPUT "Number of kangaroos on each side? ", N%

PRINT

move.amount% = N% * N% + 2 * N%

spaces.amount% = N% * 2 + 1

DIM SHARED move(move.amount%) AS INTEGER

DIM SHARED type1(move.amount%) AS INTEGER

DIM SHARED kangaroo.string$: kangaroo.string$ = SPACE$(spaces.amount%)

FOR i% = 1 TO spaces.amount%

SELECT CASE i%

CASE IS < N% + 1: MID$(kangaroo.string$, i%, 1) = ">"

CASE IS = N% + 1: MID$(kangaroo.string$, i%, 1) = "_"

CASE IS > N% + 1: MID$(kangaroo.string$, i%, 1) = "<"

END SELECT

NEXT i%

k% = 0: j% = 0: k2% = 0: counter% = 1: counter2% = 1

FOR i% = 1 TO move.amount% \ 2

IF j% = k% THEN k% = k% + 1: j% = 0: move(i%) = -1 ELSE j% = j% + 1

IF j2% = k2% THEN k2% = k2% + 1: j2% = 1: temp% = 1 - temp% ELSE j2% = j2% + 1

type1%(i%) = temp%

NEXT i%

FOR i% = move.amount% \ 2 + 1 TO move.amount%

i2% = move.amount% - i% + 1: move%(i%) = move%(i2%): type1(i%) = type1(i2%)

NEXT i%

cur.empty% = N% + 1: s1$ = "_"

FOR i% = 1 TO move.amount%

IF type1(i%) THEN next.empty% = cur.empty% - move%(i%) - 2 ELSE next.empty% = cur.empty% + move(i%) + 2

s2$ = MID$(kangaroo.string$, next.empty%, 1)

MID$(kangaroo.string$, next.empty%, 1) = s1$

MID$(kangaroo.string$, cur.empty%, 1) = s2$

cur.empty% = next.empty%

PRINT kangaroo.string$ + " "; : IF move%(i%) THEN PRINT "hop" ELSE PRINT "jump"

IF CSRLIN = 24 THEN

1 : IF INKEY$ = "" THEN GOTO 1

CLS

END IF

NEXT i%

SYSTEM