You have quarters laid out in the following pattern on the left and you want to move quarters to form the pattern on the right.
Q Q Q
Q Q Q Q
Q Q Q Q Q
Before| |After
The only rule is you must slide a coin without moving any others, such that the coin's ending location touches two other quarters. This means the following moves are illegal:
A 1 Moving C to 1
B C D 2 Moving B to 2
E F
What is the shortest solution?
A
B C
D E F
------------
A
E B C
D F
------------
E B C
A D F
------------
E B
A D F
C
------------
E B
A D F
C
------------
E B
A D
C F
------------
This may not be the shortest, but it will do for now.
-Jer
|
Posted by Jer
on 2004-03-26 14:22:11 |