(self, x, y, lim)
| 22 | self.body.append(p) |
| 23 | |
| 24 | def snap(self, x, y, lim): |
| 25 | cur, minl = None, 1000 |
| 26 | for i in self.body: |
| 27 | d = (i[0]-x)**2+(i[1]-y)**2 |
| 28 | if d < minl:cur,minl = i,d |
| 29 | if minl**0.5>lim:return None |
| 30 | return self.body.index(cur) |
| 31 | |
| 32 | def pick(self, x, y, lim): |
| 33 | return self.snap(x, y, lim) |
no outgoing calls
no test coverage detected