Fixing Circles RIght Now!!!!!!
This commit is contained in:
@@ -50,11 +50,12 @@ var Move_Check6 = 0
|
|||||||
var Move_Check7 = 0
|
var Move_Check7 = 0
|
||||||
var Move_Check9 = 0
|
var Move_Check9 = 0
|
||||||
var Cicling = false
|
var Cicling = false
|
||||||
|
var CircleIntsMax = 0
|
||||||
var CircleInts = 0
|
var CircleInts = 0
|
||||||
var LogDumpOrdered = []
|
var LogDumpOrdered = []
|
||||||
var Order = []
|
var Order = []
|
||||||
var Intersections_from_root = []
|
var Intersections_from_root = []
|
||||||
var TargetCord = [2,-10]
|
var TargetCord = [200,-10] # 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": [] }
|
||||||
@@ -66,6 +67,7 @@ var Invert = false
|
|||||||
var InvertionArray = []
|
var InvertionArray = []
|
||||||
var CordsDump = []
|
var CordsDump = []
|
||||||
var FullCount = 0
|
var FullCount = 0
|
||||||
|
var Done = 0
|
||||||
|
|
||||||
func _input(event):
|
func _input(event):
|
||||||
if Current_Position != TargetCord:
|
if Current_Position != TargetCord:
|
||||||
@@ -104,12 +106,20 @@ func _process(delta):
|
|||||||
SolvinCircleDeadEnds()
|
SolvinCircleDeadEnds()
|
||||||
MoveAfterIntersection()
|
MoveAfterIntersection()
|
||||||
IntersectionWaysAvailable()
|
IntersectionWaysAvailable()
|
||||||
IntersectionDumping()
|
IntersectionDumping()
|
||||||
CordsDumping()
|
CordsDumping()
|
||||||
#print(InverNext)
|
#print(InverNext)
|
||||||
#print(CordsDump)
|
#print(CordsDump)
|
||||||
else:
|
else:
|
||||||
print("We Done!!!!!!!!!!!!!!!!!!!!!!!")
|
if Done != 1:
|
||||||
|
print("******************************")
|
||||||
|
print()
|
||||||
|
print()
|
||||||
|
print("We Done!!!!!!!!!!!!!!!!!!!!!!!")
|
||||||
|
print()
|
||||||
|
print()
|
||||||
|
print("******************************")
|
||||||
|
Done = 1
|
||||||
|
|
||||||
func Mark(Prev_Direction):
|
func Mark(Prev_Direction):
|
||||||
|
|
||||||
@@ -156,7 +166,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()
|
||||||
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)
|
||||||
print("To get to the last intersection follow these steps : ", TrackBack)
|
print("To get to the last intersection follow these steps : ", TrackBack)
|
||||||
@@ -168,20 +178,36 @@ func Circling():
|
|||||||
if Been_There_Array.size() > 3:
|
if Been_There_Array.size() > 3:
|
||||||
if move_check5 != move:
|
if move_check5 != move:
|
||||||
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:
|
||||||
var holder = []
|
# var holder = []
|
||||||
for n in (move - BackTrack_Array[-1]):
|
# for n in (move - BackTrack_Array[-1]):
|
||||||
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("Circling")
|
print("Circling")
|
||||||
Cicling = true
|
Cicling = true
|
||||||
Individual_Steps.push_front(holder)
|
#ndividual_Steps.push_front(holder)
|
||||||
CircleRootsAndInts()
|
#CircleRootsAndInts()
|
||||||
HowManyIntsInCircle()
|
HowManyIntsInCircle()
|
||||||
FirstCirclePart()
|
if CircleInts == 0:
|
||||||
|
print("This Circle is exhausted go back")
|
||||||
|
print(Individual_Steps)
|
||||||
|
for n in CircleIntsMax:
|
||||||
|
Individual_Steps.pop_front()
|
||||||
|
GoBack(Individual_Steps[0])
|
||||||
|
|
||||||
|
if CircleInts != 0:
|
||||||
|
print("Go back to circle part :(")
|
||||||
|
#FirstCirclePart()
|
||||||
move_check5 = move
|
move_check5 = move
|
||||||
|
|
||||||
func HowManyIntsInCircle():
|
func HowManyIntsInCircle():
|
||||||
CircleInts = Tree_Array.size() - Intersections.find(Current_Position)+1
|
|
||||||
|
var subtractor = 0
|
||||||
|
CircleIntsMax = Intersections.size() - (Intersections.find(Current_Position)+1)
|
||||||
|
CircleInts = CircleIntsMax
|
||||||
|
for n in CircleInts:
|
||||||
|
if Tree_Array[-(n+1)] == 1:
|
||||||
|
CircleInts -= 1
|
||||||
print(CircleInts)
|
print(CircleInts)
|
||||||
|
|
||||||
func FirstCirclePart():
|
func FirstCirclePart():
|
||||||
@@ -343,7 +369,7 @@ func MoveAfterIntersection():
|
|||||||
Move_Check6 = move
|
Move_Check6 = move
|
||||||
|
|
||||||
func IntersectionDumping():
|
func IntersectionDumping():
|
||||||
if CurrentInt != "Plain Path" and Detail_Dict.Type != "Dead End":
|
if CurrentInt != "Plain Path" and Detail_Dict.Type != "Dead End" and Been_There_Array.size() >=1:
|
||||||
if Move_Check9 != move or Been_There_Array[-1] == true:
|
if Move_Check9 != move or Been_There_Array[-1] == true:
|
||||||
IntersectionMove = move
|
IntersectionMove = move
|
||||||
IntersectionDump.push_back(Current_Position)
|
IntersectionDump.push_back(Current_Position)
|
||||||
|
|||||||
Reference in New Issue
Block a user