Taddeus Kroes hace 6 años
padre
commit
adebbd5cbe
Se han modificado 1 ficheros con 1 adiciones y 3 borrados
  1. 1 3
      2016/13_cubicles.py

+ 1 - 3
2016/13_cubicles.py

@@ -40,11 +40,9 @@ def shortest_path(source, dest):
             return dist
 
 def reachable_in(source, maxdist):
-    count = 0
-    for node, dist in uniform_cost_search(source):
+    for count, (node, dist) in enumerate(uniform_cost_search(source)):
         if dist > maxdist:
             return count
-        count += 1
 
 print(shortest_path((1, 1), (31, 39)))
 print(reachable_in((1, 1), 50))