]> Skullheadx's Git Forge - CCC.git/commitdiff
Update S4.py
authorSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Thu, 10 Nov 2022 17:34:59 +0000 (12:34 -0500)
committerSkullheadx <94652084+Skullheadx@users.noreply.github.com>
Thu, 10 Nov 2022 17:34:59 +0000 (12:34 -0500)
Main/Python/2010/S4.py

index 20bc12ae8726785948b9e22f62dbac74442175df..6818f1afa85c81eb10d468cefa4e624c0e27115e 100644 (file)
@@ -39,8 +39,16 @@ def deep_copy(dictionary):
     return out
 
 q = Queue()
-for i in fences:
-    q.put(([i], tree))
+# for i in fences:
+#     q.put(([i], tree))
+tree[2].remove(3)
+tree[3].remove(2)
+tree[4].remove(5)
+tree[5].remove(4)
+tree[4].remove(7)
+tree[7].remove(4)
+
+q.put(([(2,3),(4,5),(4,7)], tree))
 
 
 
@@ -65,21 +73,22 @@ while not q.empty():
             c,seen = q2.get()
             if c == i:
                 loops += 1
-                if loops > 1:
-                    is_solution = False
-                    break
+                if loops > 1:
+                    is_solution = False
+                    break
 
             if c in seen:
                 continue
             else:
                 seen.add(c)
                 global_seen.add(c)
-
+            print(c, seen)
             for j in pen[c]:
                 q2.put((j,seen.copy()))
                 # print(c,j,seen, loops)
 
-
+        print(loops)
+        quit()
         if loops == 0:
             broken_out = True
 
@@ -96,14 +105,7 @@ while not q.empty():
         for i in current:
             output += fences[i]
         print(output, current, node_loops)
-        quit()
-
-
-
-
-
-
-
+    quit()
 
     # find next
     for fence in fences: