grid based pathfinding algorithms written in ruby