You are viewing a single comment's thread. Return to all comments →
Haskell (excluding reading logic):
solve x = solve' (x ++ [head x]) solve' ((x1, y1):(x2, y2):xs) = distance + solve' ((x2, y2):xs) where distance = sqrt ((x2 - x1)^2 + (y2 - y1)^2) solve' _ = 0
Seems like cookies are disabled on this browser, please enable them to open this website
Compute the Perimeter of a Polygon
You are viewing a single comment's thread. Return to all comments →
Haskell (excluding reading logic):