Testing Multi object solve. I need to fix Tree array Bug with DE

This commit is contained in:
2024-10-15 08:12:22 -04:00
parent f3252a4405
commit 132d7d43c4
2 changed files with 20 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ var Intersections = [[]]
var Intersections_Copy = []
var Distance_From_Intersection = 0
var Tree_Array = []
var Tree_Array = [99]
var Options = []
var BackTrack_Array = []
var Traveled = false
@@ -59,7 +59,7 @@ var CircleInts = 0
var LogDumpOrdered = []
var Order = []
var Intersections_from_root = []
var TargetCord = [[0,-11], [13,-13]] # HAD TO CHANGE TARGET CORD, IT WAS PREVIOUSLY [2,-10]
var TargetCord = [[0,-11], [13,-13], [1,-20]] # HAD TO CHANGE TARGET CORD, IT WAS PREVIOUSLY [2,-10]
var CircleCompleted = null
var AutoBacktrack = false
var IntersectionDict = {"Cord": [], "Data": [] }
@@ -76,6 +76,7 @@ var Root = []
var FirstGoTo = []
var AllSetsToGoal = []
var TargetsArray = []
var Goal = false
func _input(event):
#if Current_Position != TargetCord:
@@ -99,7 +100,8 @@ func _input(event):
AutoSolve()
func _process(delta):
#FoundGoal()
AllObjectsFound()
CallableRaycastData()
Mark(Prev_dir)
WhatMove()
@@ -117,7 +119,7 @@ func _process(delta):
IntersectionDumping()
CordsDumping()
FinishCircling()
FoundGoal()
print(Tree_Array)
#if Detail_Dict.Type == "3 Way Intersection":
# print(Individual_Steps)
#print(Detail_Dict.Type)
@@ -142,6 +144,7 @@ func _process(delta):
func FoundGoal():
if TargetCord.find(Current_Position) != -1 and TargetsArray.find(Current_Position) == -1:
Goal = true
print("GOAL!!!!!!!!!!!")
if Done != move:
print("Circling is: ", Cicling)
@@ -160,6 +163,10 @@ func FoundGoal():
print("Here is the Set to go to young bull: ",AllSetsToGoal)
Done = move
func AllObjectsFound():
if Tree_Array.is_empty() and IntersectionDump.size() > 0:
print("Solved")
return true
func Mark(Prev_Direction):
@@ -459,15 +466,14 @@ func Intersection_Tree():
Move_Check2 = move
func CheckForTreeDeadEnds():
if Tree_Array.size() > 0:
if Tree_Array[-1] <= 0:
print(Tree_Array)
Tree_Array[- 1] -= 1
print(Individual_Steps[0])
if Tree_Array.size() > 0:
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
Tree_Array.pop_back()
Tree_Array[-1] -= 1
print(Tree_Array)
else:
pass

File diff suppressed because one or more lines are too long