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