smack42 / DriftingDroids

DriftingDroids - yet another Ricochet Robots solver program
https://github.com/smack42/DriftingDroids/wiki
GNU General Public License v3.0
41 stars 12 forks source link

Non optimal solution #20

Closed kristianbenoit closed 3 years ago

kristianbenoit commented 4 years ago

I am playing with the problems from Robot Reboot, and I find a solution to this problem in 8 moves:

  1. Green W
  2. Blue S
  3. Blue S E
  4. Red S
  5. Green E
  6. Green N
  7. Green W
  8. Red N

while Drifting Droid find the best solution in 12 moves:

indice : la solution comporte 12 mouvements.

  1. → jaune Est
  2. ↓ jaune Sud
  3. ← vert Ouest
  4. ↓ bleu Sud
  5. → bleu Est
  6. ↓ rouge Sud
  7. ← jaune Ouest
  8. ← bleu Ouest rebond
  9. ← rouge Ouest
  10. ↓ bleu Sud
  11. → rouge Est rebond
  12. ↑ rouge Nord
rubo77 commented 4 years ago

This is a known problem and it occurs only if the robot is in the same row as the target with one move crossing it

smack42 commented 4 years ago

Thanks for reporting this issue.

As Ruben already mentioned, this is a known problem. It was reported as issue #13 and is already fixed in the current development version.

The solver algorithm just works according to the rules of Ricochet Robots, which say:

On its way to the target, a robot must ricochet at least once, i.e. change its direction 90 degrees (in other words, a right angle, as shown above) after a move. If a robot could move directly to the target space without ricocheting, it has to take another route.

The program change, to disregard this rule when playing on custom boards (not from Ricochet Robots) and it's not a 1-move solution, will be included in the next release version of DriftingDroids. I want to release this shortly, within the next few days.

smack42 commented 3 years ago

closed by release 1.3.8