𓁟 host1.bitchan.one

𓀐 @JPFvTR3A: This is the future you chose.

I attempted this exercise by myself and failed to do linear interpolation. I've also come to realize AI is rotting my brain because I was having trouble even remembering how to traverse a linked list. my broken solution: static bool UnderTheLine(Node line, Point target) { while (line.Next != null) { if (target.Y >= line.Point.Y && target.Y <= line.Next.Point.Y) return true; line = line.Next; } return false; } actual solution: static bool UnderTheLine(Node line, Point target) { while (line.Next != null) { Point a = line.Point; Point b = line.Next.Point; if (target.X >= a.X && target.X <= b.X) { double slope = ((double)b.Y - a.Y) / (b.X - a.X); double lineY = a.Y + slope * (target.X - a.X); return target.Y < lineY; } line = line.Next; } return false; }

⧖expiring0/1 kept5d ago

𓀐 @F6eWT4V?

⏱ 5d 👍 0

⬆ upvote 0