All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Trading Places 2D (Posted on 2006-06-07) Difficulty: 3 of 5
Markers can move forward one square, or can jump over a marker of either colour if there is an empty square to land on.
Markers are not removed from the board if jumped.
You DO NOT have to alternate moving black and white markers.
The x's move E or S and o's move N or W and the goal is to make the x's and o's change places in these two board positions and in the general case.

+-+-+-+    N
|x|x|x|  W + E
+-+-+-+    S
|x| |o|


|x|x| |o|o|

No Solution Yet Submitted by Sir Percivale    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution Solution | Comment 2 of 3 |

Consider the medium case (the small is similar enough).

The center row is the key.  It looks just like the 1D version of this problem.  If this row were all blanks, the five columns would also be 1D versions. 

Think of solving the center row as usual except the first time each of the squares is a blank use the opportunity to solve that column.

It wasn't asked, but the total number of moves would just be 6 times the number required for a simple xx_oo problem.  (The easy would take 4 times the number required for x_o 4*3=12)

  Posted by Jer on 2006-06-07 11:57:32
Please log in:
Remember me:
Sign up! | Forgot password

Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (1)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Copyright © 2002 - 2018 by Animus Pactum Consulting. All rights reserved. Privacy Information