Working on circles

This commit is contained in:
2024-10-03 08:07:52 -04:00
parent 8a35e51d21
commit b15eaec8be

View File

@@ -69,6 +69,7 @@ var InvertionArray = []
var CordsDump = [] var CordsDump = []
var FullCount = 0 var FullCount = 0
var Done = 0 var Done = 0
var Root = []
func _input(event): func _input(event):
if Current_Position != TargetCord: if Current_Position != TargetCord:
@@ -181,8 +182,9 @@ func Circling():
if Intersections.find(Current_Position) != Intersections.size()-1 and Intersections.find(Current_Position) != -1 and Been_There_Array[-2] == false and Been_There_Array[-3] == false: if Intersections.find(Current_Position) != Intersections.size()-1 and Intersections.find(Current_Position) != -1 and Been_There_Array[-2] == false and Been_There_Array[-3] == false:
print("Circling") print("Circling")
Cicling = true Cicling = true
#ndividual_Steps.push_front(holder) Root = Current_Position
#CircleRootsAndInts() print("The Root is equal to: ",Root, " and its position in int array is: ", Intersections.find(Root))
print("There are ", Intersections.size() - Intersections.find(Root), " Intersections")
HowManyIntsInCircle() HowManyIntsInCircle()
if CircleInts == 0: if CircleInts == 0:
print("This Circle is exhausted go back") print("This Circle is exhausted go back")
@@ -207,12 +209,30 @@ func HowManyIntsInCircle():
print(CircleInts) print(CircleInts)
func FirstCirclePart(): func FirstCirclePart():
var Skipping_array = []
print(Tree_Array)
for nums in Intersections.size() - Intersections.find(Root):
if nums > 0:
Skipping_array.push_back((Intersections.find(Root) - nums) + 1)
print(Skipping_array)
for x in Skipping_array:
print(x)
if Tree_Array[x] == 1:
print("Skip")
GoToParts()
else:
print("Go To")
func GoToParts():
var holder = [] var holder = []
for n in (move - BackTrack_Array[-1] + 1): for n in (CircleManualDistance()):
#holder.push_back(LogDump[n]) #holder.push_back(LogDump[n])
holder.push_front(Prev_dir_Opp) holder.push_front(Prev_dir_Opp)
print(holder) print(holder)
GoBack(holder) print(LogDump)
#GoBack(holder)
func CircleRootsAndInts(): func CircleRootsAndInts():
if Cicling == true: if Cicling == true:
@@ -248,6 +268,15 @@ func CircleManualDistance():
var y = abs(Starting_Pos[1] - Ending_Pos[1]) var y = abs(Starting_Pos[1] - Ending_Pos[1])
return x+y return x+y
func ManualDistance(Start, End):
if DeadEndCircles() == true and Intersections_from_root.size() >= 2:
var Starting_Pos = Start
var Ending_Pos = End
var x = abs(Starting_Pos[0] - Ending_Pos[0])
var y = abs(Starting_Pos[1] - Ending_Pos[1])
return x+y
func Intersection_Tree(): func Intersection_Tree():
if Cicling == false: if Cicling == false:
@@ -305,7 +334,7 @@ func TrackIntersections():
func MoveAfterIntersection(): func MoveAfterIntersection():
if move == IntersectionMove+1: if move == IntersectionMove+1:
if Move_Check6 != move: if Move_Check6 != move and Cicling == false:
if TrackBack.size() != 1 and BackTrack_Array.size() > 1: if TrackBack.size() != 1 and BackTrack_Array.size() > 1:
IntersectionDir.push_back(LogDumpOrdered[0]) IntersectionDir.push_back(LogDumpOrdered[0])
if BackTrack_Array.size() > 1 and BackTrack_Array[-1] - BackTrack_Array[-2] == 1: if BackTrack_Array.size() > 1 and BackTrack_Array[-1] - BackTrack_Array[-2] == 1: