Skip to content

Commit

Permalink
bla
Browse files Browse the repository at this point in the history
  • Loading branch information
polmuz committed Jul 9, 2012
1 parent c6a3152 commit 6fa812f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bots/butterfly.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ def walk_the_park(self, gps):
angle = gps['angle']
if self.steps % 20 == 0:
self.dx, self.dy = self.get_new_destination(gps)
print self.dx, self.dy
turn = relative_angle(x, y, self.dx, self.dy, angle)
return turn, 1

Expand All @@ -103,10 +102,9 @@ def get_new_destination(self, gps):
for d in self.directions:
pdx, pdy = x + d[0], y + d[1]
if not self.collides(x, y, pdx, pdy) \
and math.fabs(relative_angle(x, y, pdx, pdy, angle)) < 5:
print relative_angle(x, y, pdx, pdy, angle)
and math.fabs(relative_angle(x, y, pdx, pdy, angle)) < 4:
return pdx, pdy
return 0, 0
return self.directions[0]

def collides(self, x, y, pdx, pdy):
for w in self.get_walls():
Expand Down

0 comments on commit 6fa812f

Please sign in to comment.