Fixing Circles RIght Now!!!!!!
This commit is contained in:
@@ -50,11 +50,12 @@ var Move_Check6 = 0
|
||||
var Move_Check7 = 0
|
||||
var Move_Check9 = 0
|
||||
var Cicling = false
|
||||
var CircleIntsMax = 0
|
||||
var CircleInts = 0
|
||||
var LogDumpOrdered = []
|
||||
var Order = []
|
||||
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 AutoBacktrack = false
|
||||
var IntersectionDict = {"Cord": [], "Data": [] }
|
||||
@@ -66,6 +67,7 @@ var Invert = false
|
||||
var InvertionArray = []
|
||||
var CordsDump = []
|
||||
var FullCount = 0
|
||||
var Done = 0
|
||||
|
||||
func _input(event):
|
||||
if Current_Position != TargetCord:
|
||||
@@ -104,12 +106,20 @@ func _process(delta):
|
||||
SolvinCircleDeadEnds()
|
||||
MoveAfterIntersection()
|
||||
IntersectionWaysAvailable()
|
||||
IntersectionDumping()
|
||||
IntersectionDumping()
|
||||
CordsDumping()
|
||||
#print(InverNext)
|
||||
#print(CordsDump)
|
||||
else:
|
||||
print("We Done!!!!!!!!!!!!!!!!!!!!!!!")
|
||||
if Done != 1:
|
||||
print("******************************")
|
||||
print()
|
||||
print()
|
||||
print("We Done!!!!!!!!!!!!!!!!!!!!!!!")
|
||||
print()
|
||||
print()
|
||||
print("******************************")
|
||||
Done = 1
|
||||
|
||||
func Mark(Prev_Direction):
|
||||
|
||||
@@ -156,7 +166,7 @@ func BackTracking():
|
||||
BackTrack_Array.push_back(move)
|
||||
if Intersections.find(Current_Position) == -1 and Intersections.find(Current_Position) != Intersections.size() -1 and BackTrack_Array.size() >= 2:
|
||||
TrackBack = GiveOrder()
|
||||
print(TrackBack)
|
||||
#print(TrackBack)
|
||||
Distance_From_Intersection = BackTrack_Array[-1] - BackTrack_Array[-2]
|
||||
print("The distance from the last intersection is : ", Distance_From_Intersection)
|
||||
print("To get to the last intersection follow these steps : ", TrackBack)
|
||||
@@ -168,20 +178,36 @@ func Circling():
|
||||
if Been_There_Array.size() > 3:
|
||||
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:
|
||||
var holder = []
|
||||
for n in (move - BackTrack_Array[-1]):
|
||||
holder.push_back(LogDump[n])
|
||||
holder.push_front(Prev_dir_Opp)
|
||||
# var holder = []
|
||||
# for n in (move - BackTrack_Array[-1]):
|
||||
# holder.push_back(LogDump[n])
|
||||
#holder.push_front(Prev_dir_Opp)
|
||||
#print(holder)
|
||||
print("Circling")
|
||||
Cicling = true
|
||||
Individual_Steps.push_front(holder)
|
||||
CircleRootsAndInts()
|
||||
#ndividual_Steps.push_front(holder)
|
||||
#CircleRootsAndInts()
|
||||
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
|
||||
|
||||
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)
|
||||
|
||||
func FirstCirclePart():
|
||||
@@ -343,7 +369,7 @@ func MoveAfterIntersection():
|
||||
Move_Check6 = move
|
||||
|
||||
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:
|
||||
IntersectionMove = move
|
||||
IntersectionDump.push_back(Current_Position)
|
||||
|
||||
Reference in New Issue
Block a user