07-05-2005, 10:43 PM
Yeah, yours finds a shorter path. That is due mainly to 2 factors:
- Mine checks for walls adjacent to the current square (dumbledore's idea), whereas yours doesn't.
- Mine uses a different formula for calculating the hScore (dumbledore's idea). (this seems to be the biggest reason)
[/list:o]
If you implement both of those (they aren't very hard), you'll find that the fScores are the same and the same paths are taken.
Edit: I forgot to add that your Hill and Water constants are switched compared to mine. I'll change mine to match yours.
974277320612072617420666C61696C21 (Hexadecimal for those who don't know)