private static LinePath GeneratePath(string[] instructions) { var result = new LinePath(); result.AddLine(new LineSegment(new Point(0, 0), instructions.First())); instructions.Skip(1).ForEach(instruction => { result.AddLine(result.Lines.Last().Extend(instruction)); }); return(result); }
public IEnumerable <Point> Intersections(LinePath other) { return(DistanceToPoint.Keys .Intersect(other.DistanceToPoint.Keys)); }