Starting the branching for multi-object-solve :)

This commit is contained in:
2024-10-14 08:07:19 -04:00
parent cfb439deb9
commit f3252a4405

View File

@@ -59,7 +59,7 @@ var CircleInts = 0
var LogDumpOrdered = [] var LogDumpOrdered = []
var Order = [] var Order = []
var Intersections_from_root = [] var Intersections_from_root = []
var TargetCord = [0,-11] # HAD TO CHANGE TARGET CORD, IT WAS PREVIOUSLY [2,-10] var TargetCord = [[0,-11], [13,-13]] # HAD TO CHANGE TARGET CORD, IT WAS PREVIOUSLY [2,-10]
var CircleCompleted = null var CircleCompleted = null
var AutoBacktrack = false var AutoBacktrack = false
var IntersectionDict = {"Cord": [], "Data": [] } var IntersectionDict = {"Cord": [], "Data": [] }
@@ -74,9 +74,11 @@ var FullCount = 0
var Done = 0 var Done = 0
var Root = [] var Root = []
var FirstGoTo = [] var FirstGoTo = []
var AllSetsToGoal = []
var TargetsArray = []
func _input(event): func _input(event):
if Current_Position != TargetCord: #if Current_Position != TargetCord:
if event.is_action_pressed("ui_left"): if event.is_action_pressed("ui_left"):
goLeft() goLeft()
Been_There() Been_There()
@@ -97,7 +99,7 @@ func _input(event):
AutoSolve() AutoSolve()
func _process(delta): func _process(delta):
if Current_Position != TargetCord:
CallableRaycastData() CallableRaycastData()
Mark(Prev_dir) Mark(Prev_dir)
WhatMove() WhatMove()
@@ -115,6 +117,9 @@ func _process(delta):
IntersectionDumping() IntersectionDumping()
CordsDumping() CordsDumping()
FinishCircling() FinishCircling()
FoundGoal()
#if Detail_Dict.Type == "3 Way Intersection":
# print(Individual_Steps)
#print(Detail_Dict.Type) #print(Detail_Dict.Type)
#print(Ordered_Commands_Backward) #print(Ordered_Commands_Backward)
#print(InverNext) #print(InverNext)
@@ -126,28 +131,36 @@ func _process(delta):
# print(Tree_Array) # print(Tree_Array)
# print() # print()
# print("*****************************") # print("*****************************")
else:
if Done != 1: #AutoSolve()
print("******************************") #for n in Individual_Steps:
print() #print(n)
print() #GoBack(n)
print("We Done!!!!!!!!!!!!!!!!!!!!!!!") #print(CordsDump)
print()
print()
print("******************************")
#print("The last Ordered commands were: ", LogDump) func FoundGoal():
if TargetCord.find(Current_Position) != -1 and TargetsArray.find(Current_Position) == -1:
print("GOAL!!!!!!!!!!!")
if Done != move:
print("Circling is: ", Cicling) print("Circling is: ", Cicling)
print("Current Pos: ", Current_Position) print("Current Pos: ", Current_Position)
print(Intersections) print(Intersections)
Mark(Prev_dir) Mark(Prev_dir)
TrackIntersections() TrackIntersections()
BackToStart() BackToStart()
for n in Individual_Steps: TargetsArray.push_back(Current_Position)
#print(n) AllSetsToGoal.push_back(Individual_Steps)
GoBack(n) AllSetsToGoal.push_back(" BUFFER ")
#print(CordsDump) var TargetCopy = TargetsArray.duplicate(true)
var SetsCopy = AllSetsToGoal.duplicate(true)
TargetsArray = TargetCopy
AllSetsToGoal = SetsCopy
print("Here is the Set to go to young bull: ",AllSetsToGoal)
Done = move
Done = 1
func Mark(Prev_Direction): func Mark(Prev_Direction):
@@ -165,8 +178,6 @@ func BackToStart():
print(Detail_Dict.Type) print(Detail_Dict.Type)
if Detail_Dict.Type == "Plain Path" and Cicling == false: if Detail_Dict.Type == "Plain Path" and Cicling == false:
print("PLAIN PATH NORMAL") print("PLAIN PATH NORMAL")
Ordered_Commands_Backward.push_front(Prev_dir_Opp)
print(Ordered_Commands_Backward)
Individual_Steps.push_front(Ordered_Commands_Backward) Individual_Steps.push_front(Ordered_Commands_Backward)
print(Individual_Steps) print(Individual_Steps)
@@ -176,8 +187,9 @@ func BackToStart():
if Intersections.find(Current_Position) != -1: if Intersections.find(Current_Position) != -1:
print("INTERSECTION NORMAL") print("INTERSECTION NORMAL")
Ordered_Commands_Backward.push_back(Prev_dir_Opp) #Ordered_Commands_Backward.push_back(Prev_dir_Opp)
Ordered_Commands_Backward.reverse() #Ordered_Commands_Backward.reverse()
if Ordered_Commands_Backward.size() > 0:
Individual_Steps.push_front(Ordered_Commands_Backward) Individual_Steps.push_front(Ordered_Commands_Backward)
print(Individual_Steps) print(Individual_Steps)