Jarosh / Exercises

18 stars 3 forks source link

Knight problem #4

Open seyfer opened 7 years ago

seyfer commented 7 years ago

@Jarosh your solution is wrong. There is no restriction in the task, that knight could move only forward and not backward. You misunderstood the task.

Read an answer here for an explanation. http://codereview.stackexchange.com/questions/40394/calculate-the-number-of-moves-requires-for-a-knight-chess-piece

For the right solution, we need to use BFS algorithm.

seyfer commented 7 years ago

@Jarosh please read this

http://seyferseed.ru/en/life-en/knight-distance-problem-php.html and change or remove your solution. Or at least put stress in the description that it's wrong!