That's a pretty bad way to do it.
What is your goal in life? Or more specifically, what is your goal by solving this problem?
You haven't specified your question enough, either. Do you want the algorithm to punish walks that have more grey squares? Which of these are more diagonal?
***.. ***..
...*. ..**.
....* ...**
....* ....*
....* ....*
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177