There are two outcomes for my test, either "ErrorTooLongForProcess" or I fail this test: "assert(is_covered([300,150],[[40,60,240],[240,140,100],[295,10,50]])) == False"
My Code:
def is_covered(room, sensors):
step = 0.2
for i in numpy.arange(0, room[0]+step, step):
for j in numpy.arange(0, room[1]+step, step):
if not check_sensor(sensors, 0, i, j):
return False
return True
def check_sensor(sensor, current, i, j):
if current == len(sensor):
return False
if not (i - sensor[current][0]) ** 2 + (j - sensor[current][1]) ** 2 <= sensor[current][2] ** 2:
return check_sensor(sensor, current+1, i, j)
else:
return True
This one is "ErrorTooLongForProcess", if I change step to 0.3 it fails the test.
Ok I could test anything in between, but I don't think, thats the plan.
Any help?
Created at: 2020/08/12 12:48; Updated at: 2020/08/12 14:39