Skip to content

Commit

Permalink
Merge pull request #66 from KRSSG/thebhatman-patch-1
Browse files Browse the repository at this point in the history
Changed .size() to len() for homePos and awayPos
  • Loading branch information
thebhatman authored Jun 24, 2019
2 parents 6fe6ee9 + c460283 commit fbb88a3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/state_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def closest_opponent(state, position):
def our_bot_closest_to_ball(state):
distance_from_ball = 99999999
our_bot_closest_to_ball = 0
for i in range(state.homePos.size()):
for i in range(len(state.homePos)):
dist = math.sqrt(pow((state.homePos[i].x - state.ballPos.x),2) + pow((state.homePos[i].y - state.ballPos.y) , 2))
if dist < distance_from_ball :
distance_from_ball = dist
Expand All @@ -95,7 +95,7 @@ def our_bot_closest_to_ball(state):
def opp_bot_closest_to_ball(state):
distance_from_ball = 99999999
opp_bot_closest_to_ball = 0
for i in range(state.awayPos.size()):
for i in range(len(state.awayPos)):
dist = math.sqrt(pow((state.awayPos[i].x - state.ballPos.x),2) + pow((state.awayPos[i].y - state.ballPos.y) , 2))
if dist < distance_from_ball :
distance_from_ball = dist
Expand Down

0 comments on commit fbb88a3

Please sign in to comment.