Skip to content

Commit

Permalink
Pep8
Browse files Browse the repository at this point in the history
  • Loading branch information
fisadev committed Jul 8, 2012
1 parent 9776eab commit d41d59c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions bots/fisa.py
Expand Up @@ -50,7 +50,6 @@ def wall_between(self, position):
return True
return False


def messageReceived(self, msg):
msg = bunchify(msg)

Expand Down Expand Up @@ -101,8 +100,10 @@ def messageReceived(self, msg):
else:
# move N times, then rotate N times
# will hit wall?
pointing_vector = cmath.rect(WALL_SAFE_DISTANCE, self.angle)
pointing_vector = Vector2(pointing_vector.real, pointing_vector.imag)
pointing_vector = cmath.rect(WALL_SAFE_DISTANCE,
self.angle)
pointing_vector = Vector2(pointing_vector.real,
pointing_vector.imag)
pointing_to = predict_pos(self.pos, pointing_vector)
wall_in_front = self.wall_between(pointing_to)

Expand Down Expand Up @@ -155,11 +156,12 @@ def predict_pos(point, velocity, modifier=1):
return point + v


def ccw(a,b,c):
return (c[1]-a[1])*(b[0]-a[0]) > (b[1]-a[1])*(c[0]-a[0])
def ccw(a, b, c):
return (c[1] - a[1]) * (b[0] - a[0]) > (b[1] - a[1]) * (c[0] - a[0])


def intersect(a,b,c,d):
return ccw(a,c,d) != ccw(b,c,d) and ccw(a,b,c) != ccw(a,b,d)
def intersect(a, b, c, d):
return ccw(a, c, d) != ccw(b, c, d) and ccw(a, b, c) != ccw(a, b, d)


def main():
Expand Down

0 comments on commit d41d59c

Please sign in to comment.