@@ -56,15 +56,16 @@ def third_step(start, points_pixels, logger):
5656 if len (ways ) == 0 :
5757 break
5858 else :
59+ if len (ways ) == 1 :
60+ logger .info ("now_ways_pasts={}" .format (now_way_pasts ))
61+
5962 now_way = ways [0 ]
6063 now_way_pasts = now_way .pasts
61- logger . info ("len(ways)={}, now_ways_pasts={}" .format (len (ways ), now_way_pasts ))
64+ print ("len(ways)={}, now_ways_pasts={}" .format (len (ways ), now_way_pasts ))
6265 x = now_way_pasts [- 1 ][0 ]
6366 y = now_way_pasts [- 1 ][1 ]
6467 points = find_next_point (points_pixels , x , y , now_way_pasts , logger )
6568 if points is None :
66- # logger.info("removing a way, now_way's pasts={}".format(now_way.pasts))
67- print ("removing a way, now_way's pasts={}" .format (now_way .pasts ))
6869 ways .remove (now_way )
6970 else :
7071 len_points = len (points )
@@ -73,6 +74,7 @@ def third_step(start, points_pixels, logger):
7374 next_point_x = next_point [0 ]
7475 next_point_y = next_point [1 ]
7576 if next_point_y == 640 :
77+ logger .info ("now_way={}, now_way's pasts={}, next_point={}" .format (now_way , now_way .pasts , next_point ))
7678 break
7779 now_way_pasts .append ((next_point_x , next_point_y ))
7880 elif len_points > 1 :
@@ -85,7 +87,6 @@ def third_step(start, points_pixels, logger):
8587
8688
8789def find_next_point (points_pixels , x , y , past , logger ):
88- # logger.info("now is ({}, {}) finding next_point".format(x, y))
8990 right_x = x + 1
9091 left_x = x - 1
9192 up_y = y - 1
@@ -127,12 +128,9 @@ def find_next_point(points_pixels, x, y, past, logger):
127128 now_index = past .index ((x , y ))
128129 before = past [now_index - 1 ]
129130 if before == point :
130- # logging.info("removing {}".format(point))
131131 points .remove (point )
132132 if len (points ) < 1 :
133- # logger.info("return None")
134133 return None
135- # logger.info("return points={}".format(points))
136134 return points
137135
138136
0 commit comments