Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

For starters, the "solution" here doesn't ensure that the ending piece meets the starting piece in the right direction. :p


Ok, a snarky way to phrase things, but it's a good point - in general the vectors could add to zero and the angles may not align. So perhaps a better expression may be

a metric for tension = [ norm(sum(piece_vectors)) + abs(angle_displacement) ] / n

where

angle_displacement = sum(angles) - 360

and the angles are signed accordingly.


Counterexample: a dozen (+1, 0) tiles followed by a dozen (-1, 0) tiles. Vector sum is fine, total angle is fine, but at each end you have an impossible 180 deg connection. I don’t think you can get away from local measures of tension with a global look.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: