Compare commits
2 Commits
5c3bfa56b0
...
8c977a3e58
| Author | SHA1 | Date | |
|---|---|---|---|
| 8c977a3e58 | |||
| f204d72850 |
@@ -30,7 +30,9 @@ var move_check = 0
|
|||||||
var ways = ["None", "Dead End", "Plain Path", "3 Way Intersection", "4 Way Intersection"]
|
var ways = ["None", "Dead End", "Plain Path", "3 Way Intersection", "4 Way Intersection"]
|
||||||
var ignore = false
|
var ignore = false
|
||||||
var Ordered_Commands_Backward = []
|
var Ordered_Commands_Backward = []
|
||||||
|
var Ordered_Commands_Forward = []
|
||||||
var Individual_Steps = []
|
var Individual_Steps = []
|
||||||
|
var Individual_Steps_Opp = []
|
||||||
var Back_To_Start = []
|
var Back_To_Start = []
|
||||||
var Command = []
|
var Command = []
|
||||||
var TakeOut = 0
|
var TakeOut = 0
|
||||||
@@ -50,6 +52,7 @@ var Move_Check6 = 0
|
|||||||
var Move_Check7 = 0
|
var Move_Check7 = 0
|
||||||
var Move_Check4 = 0
|
var Move_Check4 = 0
|
||||||
var Move_Check9 = 0
|
var Move_Check9 = 0
|
||||||
|
var Move_Check10 = 0
|
||||||
var Cicling = false
|
var Cicling = false
|
||||||
var CircleIntsMax = 0
|
var CircleIntsMax = 0
|
||||||
var CircleInts = 0
|
var CircleInts = 0
|
||||||
@@ -70,6 +73,7 @@ var CordsDump = []
|
|||||||
var FullCount = 0
|
var FullCount = 0
|
||||||
var Done = 0
|
var Done = 0
|
||||||
var Root = []
|
var Root = []
|
||||||
|
var FirstGoTo = []
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
if Current_Position != TargetCord:
|
if Current_Position != TargetCord:
|
||||||
@@ -110,6 +114,8 @@ func _process(delta):
|
|||||||
IntersectionWaysAvailable()
|
IntersectionWaysAvailable()
|
||||||
IntersectionDumping()
|
IntersectionDumping()
|
||||||
CordsDumping()
|
CordsDumping()
|
||||||
|
FinishCircling()
|
||||||
|
#print(Ordered_Commands_Backward)
|
||||||
#print(InverNext)
|
#print(InverNext)
|
||||||
#print(CordsDump)
|
#print(CordsDump)
|
||||||
else:
|
else:
|
||||||
@@ -168,6 +174,7 @@ func BackTracking():
|
|||||||
BackTrack_Array.push_back(move)
|
BackTrack_Array.push_back(move)
|
||||||
if Intersections.find(Current_Position) == -1 and Intersections.find(Current_Position) != Intersections.size() -1 and BackTrack_Array.size() >= 2:
|
if Intersections.find(Current_Position) == -1 and Intersections.find(Current_Position) != Intersections.size() -1 and BackTrack_Array.size() >= 2:
|
||||||
TrackBack = GiveOrder()
|
TrackBack = GiveOrder()
|
||||||
|
Individual_Steps_Opp.push_back(Ordered_Commands_Forward)
|
||||||
#print(TrackBack)
|
#print(TrackBack)
|
||||||
Distance_From_Intersection = BackTrack_Array[-1] - BackTrack_Array[-2]
|
Distance_From_Intersection = BackTrack_Array[-1] - BackTrack_Array[-2]
|
||||||
print("The distance from the last intersection is : ", Distance_From_Intersection)
|
print("The distance from the last intersection is : ", Distance_From_Intersection)
|
||||||
@@ -188,10 +195,13 @@ func Circling():
|
|||||||
HowManyIntsInCircle()
|
HowManyIntsInCircle()
|
||||||
if CircleInts == 0:
|
if CircleInts == 0:
|
||||||
print("This Circle is exhausted go back")
|
print("This Circle is exhausted go back")
|
||||||
print(Individual_Steps)
|
|
||||||
for n in CircleIntsMax:
|
for n in CircleIntsMax:
|
||||||
Individual_Steps.pop_front()
|
Individual_Steps.pop_front()
|
||||||
GoBack(Individual_Steps[0])
|
GoBack(Individual_Steps[0])
|
||||||
|
Individual_Steps.pop_front()
|
||||||
|
print(Individual_Steps)
|
||||||
|
Cicling = false
|
||||||
|
print("Circling is false!!!!")
|
||||||
|
|
||||||
if CircleInts != 0:
|
if CircleInts != 0:
|
||||||
print("Go back to circle part :(")
|
print("Go back to circle part :(")
|
||||||
@@ -217,40 +227,51 @@ func FirstCirclePart():
|
|||||||
|
|
||||||
print("Skipping Array is : ", Skipping_array)
|
print("Skipping Array is : ", Skipping_array)
|
||||||
|
|
||||||
for x in Skipping_array:
|
|
||||||
print("This is X: ",x)
|
|
||||||
|
|
||||||
if Tree_Array[x] == 1:
|
print("This is X: ",Skipping_array[0])
|
||||||
|
|
||||||
|
if Tree_Array[Skipping_array[0]] == 1:
|
||||||
print("Skip")
|
print("Skip")
|
||||||
Skip()
|
Skip()
|
||||||
|
|
||||||
else:
|
else:
|
||||||
print("Go To")
|
print("Go To")
|
||||||
#Goto()
|
Goto()
|
||||||
|
|
||||||
func Skip():
|
func Skip():
|
||||||
#print("CircleInts: ", CircleInts, " and CircleInts Max: ", CircleIntsMax)
|
print("CircleInts: ", CircleInts, " and CircleInts Max: ", CircleIntsMax)
|
||||||
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)
|
||||||
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("First Go To is : ",FirstGoTo)
|
||||||
|
|
||||||
func Goto():
|
func Goto():
|
||||||
if CircleInts + 1 == CircleIntsMax:
|
print("CircleInts: ", CircleInts, " and CircleInts Max: ", CircleIntsMax)
|
||||||
|
if CircleInts == CircleIntsMax:
|
||||||
|
print("FIRST CHANGE")
|
||||||
FirstIntChange()
|
FirstIntChange()
|
||||||
|
print("Shouldn't Need more work")
|
||||||
else:
|
else:
|
||||||
GoBack(Individual_Steps[0])
|
print("FIRST CHANGE")
|
||||||
Individual_Steps.pop_front()
|
FirstIntChange()
|
||||||
|
print("Needs More WORK!!!!!!!")
|
||||||
|
print("First Go To is : ",FirstGoTo)
|
||||||
|
|
||||||
|
|
||||||
func FirstIntChange():
|
func FirstIntChange():
|
||||||
var FirstGoTo = []
|
|
||||||
FirstGoTo.push_front(Prev_dir_Opp)
|
|
||||||
FirstGoTo.append_array(Ordered_Commands_Backward)
|
FirstGoTo.append_array(Ordered_Commands_Backward)
|
||||||
|
FirstGoTo.push_back(Prev_dir_Opp)
|
||||||
|
FirstGoTo.reverse()
|
||||||
|
print(Intersections_from_root)
|
||||||
|
print(Ordered_Commands_Backward)
|
||||||
GoBack(FirstGoTo)
|
GoBack(FirstGoTo)
|
||||||
print(FirstGoTo)
|
print(FirstGoTo)
|
||||||
|
|
||||||
@@ -259,11 +280,36 @@ func CircleRootsAndInts():
|
|||||||
if Cicling == true:
|
if Cicling == true:
|
||||||
if Detail_Dict.Type != "Plain Path":
|
if Detail_Dict.Type != "Plain Path":
|
||||||
if Intersections_from_root.find(Current_Position) == -1:
|
if Intersections_from_root.find(Current_Position) == -1:
|
||||||
|
if Intersections_from_root.size() == 0:
|
||||||
|
print(Intersections)
|
||||||
|
print(Intersections[-(CircleIntsMax+1)])
|
||||||
|
Intersections_from_root.push_back(Intersections[-(CircleIntsMax+1)])
|
||||||
Intersections_from_root.push_back(Current_Position)
|
Intersections_from_root.push_back(Current_Position)
|
||||||
var Duplicate = Intersections_from_root.duplicate(true)
|
var Duplicate = Intersections_from_root.duplicate(true)
|
||||||
Intersections_from_root = Duplicate
|
Intersections_from_root = Duplicate
|
||||||
print(Intersections_from_root)
|
print(Intersections_from_root)
|
||||||
|
|
||||||
|
func FinishCircling():
|
||||||
|
if Cicling == true:
|
||||||
|
if Move_Check10 != move:
|
||||||
|
if CircleInts == 0:
|
||||||
|
if Current_Position == Intersections[-(CircleIntsMax+1)]:
|
||||||
|
Cicling = false
|
||||||
|
print("Its On the Root!!!")
|
||||||
|
GoBack(Individual_Steps[0])
|
||||||
|
Individual_Steps.pop_front()
|
||||||
|
print(Individual_Steps)
|
||||||
|
else:
|
||||||
|
print("Its Off the Root!!!")
|
||||||
|
Cicling = false
|
||||||
|
GoBack(Individual_Steps[0])
|
||||||
|
Individual_Steps.pop_front()
|
||||||
|
GoBack(Individual_Steps[0])
|
||||||
|
Individual_Steps.pop_front()
|
||||||
|
print("Its On the Root!!!")
|
||||||
|
print(Individual_Steps)
|
||||||
|
Move_Check10 = move
|
||||||
|
|
||||||
func DeadEndCircles():
|
func DeadEndCircles():
|
||||||
if Cicling == true:
|
if Cicling == true:
|
||||||
if Detail_Dict.Type == "Dead End":
|
if Detail_Dict.Type == "Dead End":
|
||||||
@@ -334,6 +380,7 @@ func CheckForTreeDeadEnds():
|
|||||||
|
|
||||||
func GiveOrder():
|
func GiveOrder():
|
||||||
Ordered_Commands_Backward.erase("")
|
Ordered_Commands_Backward.erase("")
|
||||||
|
Ordered_Commands_Forward.erase("")
|
||||||
if move_check != move:
|
if move_check != move:
|
||||||
TrackIntersections()
|
TrackIntersections()
|
||||||
if Detail_Dict.Been_There == false:
|
if Detail_Dict.Been_There == false:
|
||||||
@@ -428,6 +475,7 @@ func IntersectionWaysAvailable():
|
|||||||
func BackToStart():
|
func BackToStart():
|
||||||
if Detail_Dict.Type == "Plain Path":
|
if Detail_Dict.Type == "Plain Path":
|
||||||
Individual_Steps.push_front(Ordered_Commands_Backward)
|
Individual_Steps.push_front(Ordered_Commands_Backward)
|
||||||
|
Individual_Steps_Opp.push_front(Ordered_Commands_Forward)
|
||||||
|
|
||||||
func Been_There():
|
func Been_There():
|
||||||
if Been_There_Overide == false:
|
if Been_There_Overide == false:
|
||||||
|
|||||||
Reference in New Issue
Block a user