Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 public IEnumerable <Point> Intersections(LinePath other)
 {
     return(DistanceToPoint.Keys
            .Intersect(other.DistanceToPoint.Keys));
 }