I have a problem with the method where I am comparing floats, since it returns bad data:
0.100000 < 0.100000 = True
def check_potential_field(current, squares):
if len(squares) == 0:
return False
for square in squares:
distance = math.sqrt(math.pow(current.x - square.x, 2) + math.pow(current.y - square.y, 2))
if distance < current.current_distance:
print "%f < %f = True" % (distance, current.current_distance)
return True
return False