Fixing circle bug with extra dead end data

This commit is contained in:
2024-10-11 08:11:11 -04:00
parent 1722272b79
commit 76cddca5a5

View File

@@ -118,6 +118,13 @@ func _process(delta):
#print(Ordered_Commands_Backward)
#print(InverNext)
#print(CordsDump)
#if Individual_Steps.size() > 7:
# print("*****************************")
# print()
# print(Individual_Steps)
# print(Tree_Array)
# print()
# print("*****************************")
else:
if Done != 1:
print("******************************")
@@ -181,6 +188,7 @@ func BackTracking():
print("To get to the last intersection follow these steps : ", TrackBack)
if Detail_Dict.Type == "Dead End" and Current_Position != [0,0]:
GoBack(TrackBack)
print(TrackBack)
func Circling():
@@ -249,13 +257,13 @@ func Skip():
if CircleInts + 1 == CircleIntsMax:
FirstIntChange()
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
#Individual_Steps.pop_front()
print("First Go To is : ",FirstGoTo)
else:
for n in 2:
print("N is equal to: ",n)
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
#Individual_Steps.pop_front()
print("Needs More WORK!!!!!!!")
print("First Go To is : ",FirstGoTo)
@@ -381,30 +389,33 @@ func Intersection_Tree():
func CheckForTreeDeadEnds():
if Tree_Array.size() > 0:
if Tree_Array[-1] <= 0:
Tree_Array.pop_back()
Tree_Array[-1] -= 1
print(Tree_Array)
print(Individual_Steps[0])
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
Tree_Array.pop_back()
Tree_Array[-1] -= 1
else:
pass
func GiveOrder():
Ordered_Commands_Backward.erase("")
Ordered_Commands_Forward.erase("")
if move_check != move:
TrackIntersections()
if Detail_Dict.Been_There == false:
Ordered_Commands_Backward.push_back(Prev_dir_Opp)
if Detail_Dict.Type != "Plain Path" and Intersections.size() > 1:
TakeOut = (Cords.size() - Cords.find(Intersections[-2]))
var test = Ordered_Commands_Backward.slice(0 , TakeOut)
test.reverse()
Ordered_Commands_Backward.clear()
return test
move_check = move
if Cicling == false:
Ordered_Commands_Backward.erase("")
Ordered_Commands_Forward.erase("")
#Ordered_Commands_Backward.clear()
if move_check != move:
TrackIntersections()
if Detail_Dict.Been_There == false:
Ordered_Commands_Backward.push_back(Prev_dir_Opp)
if Detail_Dict.Type != "Plain Path" and Intersections.size() > 1:
TakeOut = (Cords.size() - Cords.find(Intersections[-2]))
var test = Ordered_Commands_Backward.slice(0 , TakeOut)
test.reverse()
Ordered_Commands_Backward.clear()
return test
move_check = move
func TrackIntersections():
if Intersections.find(Current_Position) == -1:
@@ -558,10 +569,10 @@ func AutoSolve():
DirectionStrengths[n] -= 1000
for i in OptionArrays:
if Intersections.find(i) != -1:
DirectionStrengths[n] -= 100
if Cicling == true:
print("ITS CIRCLING DO SOME MODS")
print(IntOptions )
DirectionStrengths[n] -= 500
#if Cicling == true:
# print("ITS CIRCLING DO SOME MODS")
# print(IntOptions )
AutoBacktrack = false
var HighestPoints = DirectionStrengths.find(max(DirectionStrengths[0],DirectionStrengths[1],DirectionStrengths[2],DirectionStrengths[3]))
print(DirectionStrengths)