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.
Easy:

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


Medium:

+-+-+-+-+-+
|x|x|x|x|x|
+-+-+-+-+-+
|x|x|x|x|x|
+-+-+-+-+-+
|x|x| |o|o|
+-+-+-+-+-+
|o|o|o|o|o|
+-+-+-+-+-+
|o|o|o|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:
Login:
Password:
Remember me:
Sign up! | Forgot password


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

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information