Circles half work in orientation. I can finally move on from godot. Yipee
This commit is contained in:
@@ -116,13 +116,14 @@ func _input(event):
|
||||
func _process(delta):
|
||||
#FoundGoal()
|
||||
#AllObjectsFound()
|
||||
Circling()
|
||||
CallableRaycastData()
|
||||
Mark(Prev_dir)
|
||||
WhatMove()
|
||||
BackTracking()
|
||||
GiveOrder()
|
||||
Intersection_Tree()
|
||||
#Circling()
|
||||
|
||||
CheckForTreeDeadEnds()
|
||||
TravelLog()
|
||||
#DeadEndCircles()
|
||||
@@ -132,7 +133,7 @@ func _process(delta):
|
||||
IntersectionWaysAvailable()
|
||||
IntersectionDumping()
|
||||
CordsDumping()
|
||||
FinishCircling()
|
||||
#FinishCircling()
|
||||
#print(TrackBack)
|
||||
#print(Tree_Array)
|
||||
func FoundGoal():
|
||||
@@ -401,7 +402,6 @@ func TravelLog():
|
||||
func BackTracking():
|
||||
if Cicling == false:
|
||||
if Detail_Dict.Type != "Plain Path" and Detail_Dict.Been_There == false:
|
||||
|
||||
if BackTrack_Array.find(move) == -1:
|
||||
print("GO TIME")
|
||||
BackTrack_Array.push_back(move)
|
||||
@@ -433,11 +433,18 @@ func Circling():
|
||||
HowManyIntsInCircle()
|
||||
if CircleInts == 0:
|
||||
print("This Circle is exhausted go back")
|
||||
print(Individual_Steps)
|
||||
print(CircleIntsMax)
|
||||
for n in CircleIntsMax:
|
||||
Individual_Steps.pop_front()
|
||||
Reorient(Intersections.find(Current_Position)-1)
|
||||
FlipAround()
|
||||
print(Individual_Steps[0])
|
||||
print(Individual_Steps[0])
|
||||
GoBack(Individual_Steps[0])
|
||||
FlipAround()
|
||||
Individual_Steps.pop_front()
|
||||
print(Individual_Steps)
|
||||
#print(Individual_Steps)
|
||||
Cicling = false
|
||||
print("Circling is false!!!!")
|
||||
for ints in CircleIntsMax+1:
|
||||
@@ -446,9 +453,9 @@ func Circling():
|
||||
Ordered_Commands_Backward.clear()
|
||||
print(Tree_Array)
|
||||
|
||||
if CircleInts != 0:
|
||||
print("Go back to circle part :(")
|
||||
FirstCirclePart()
|
||||
#if CircleInts != 0:
|
||||
# print("Go back to circle part :(")
|
||||
# FirstCirclePart()
|
||||
move_check5 = move
|
||||
|
||||
func HowManyIntsInCircle():
|
||||
@@ -612,19 +619,19 @@ func Intersection_Tree():
|
||||
Move_Check2 = move
|
||||
|
||||
func CheckForTreeDeadEnds():
|
||||
|
||||
if Tree_Array.size() > 0:
|
||||
if Tree_Array[-1] <= 0:
|
||||
Tree_Array.pop_back()
|
||||
FlipAround()
|
||||
print("vvvvvv GOING FROM THIS PATH vvvvvv")
|
||||
print(Individual_Steps[0])
|
||||
GoBack(Individual_Steps[0])
|
||||
Reorient(Intersections.find(Current_Position) -1)
|
||||
Individual_Steps.pop_front()
|
||||
Tree_Array[-1] -= 1
|
||||
else:
|
||||
pass
|
||||
if Cicling == false:
|
||||
if Tree_Array.size() > 0:
|
||||
if Tree_Array[-1] <= 0:
|
||||
Tree_Array.pop_back()
|
||||
FlipAround()
|
||||
print("vvvvvv GOING FROM THIS PATH vvvvvv")
|
||||
print(Individual_Steps[0])
|
||||
GoBack(Individual_Steps[0])
|
||||
Reorient(Intersections.find(Current_Position) -1)
|
||||
Individual_Steps.pop_front()
|
||||
Tree_Array[-1] -= 1
|
||||
else:
|
||||
pass
|
||||
|
||||
func GiveOrder():
|
||||
if Cicling == false:
|
||||
@@ -1072,12 +1079,12 @@ func RMove(SetDirection):
|
||||
FullCount += 1
|
||||
|
||||
func AutoSolve():
|
||||
var DirectionStrengths = [6 ,6,8]
|
||||
var DirectionStrengths = [6 ,6,12]
|
||||
var Colliders = RaycastHelper()
|
||||
var DirArray = ["R","L","F"]
|
||||
var Turns = ["R","L"]
|
||||
var OriChange90 = ["L", "R", "F","Flip"]
|
||||
var OriChange270 = ["R", "L","FLip","F"]
|
||||
var OriChange90 = ["R", "L", "Flip","F"]
|
||||
var OriChange270 = ["L", "R","F","Flip"]
|
||||
var OriChange0 = ["Flip", "F", "L", "R"]
|
||||
var OriChnage180 = ["F","Flip","R","L"]
|
||||
var DumpDuplicate = LogDump
|
||||
@@ -1087,6 +1094,7 @@ func AutoSolve():
|
||||
var OptionArrays = [[cp[0],cp[1]+1],[cp[0],cp[1]-1],[cp[0]+1,cp[1]],[cp[0]-1,cp[1]]]
|
||||
var GoOrNot = []
|
||||
var Options = ["Above", "Below", "The Right", "The Left"]
|
||||
var FoundOrNot = [Cords.find(OptionArrays[0]),Cords.find(OptionArrays[1]),Cords.find(OptionArrays[2]),Cords.find(OptionArrays[3])]
|
||||
var ALLORI = [OriChange0,OriChange90,OriChnage180,OriChange270]
|
||||
var OriNums = [0,90,180,270]
|
||||
|
||||
@@ -1096,12 +1104,22 @@ func AutoSolve():
|
||||
DirectionStrengths[n] -= 5000
|
||||
if DirArray[n] == "R" or DirArray[n] == "L":
|
||||
if Turns.find(Prev_dir) != -1:
|
||||
print("Kill turns")
|
||||
#print("Kill turns")
|
||||
DirectionStrengths[n] -= 2500
|
||||
#for x in OptionArrays:
|
||||
#print(Ori)
|
||||
#print(Options[OptionArrays.find(x)])
|
||||
#0 #print(Cords.find(x))
|
||||
#print(FoundOrNot)
|
||||
#print(Options)
|
||||
#print(ALLORI[OriNums.find(Ori)])
|
||||
var Boom = ALLORI[OriNums.find(Ori)]
|
||||
var subtracted = []
|
||||
for x in FoundOrNot:
|
||||
if x != -1:
|
||||
subtracted.push_back(Boom[FoundOrNot.find(x)])
|
||||
subtracted.erase("Flip")
|
||||
for p in subtracted:
|
||||
var takeout = DirArray.find(p)
|
||||
DirectionStrengths[takeout] -= 1000
|
||||
|
||||
|
||||
if Individual_Steps.size() < 1 and Ordered_Commands_Backward.size() > 1:
|
||||
if Ordered_Commands_Backward[0] == DirArray[n]:
|
||||
DirectionStrengths[n] -= 25
|
||||
@@ -1129,5 +1147,5 @@ func AutoSolve():
|
||||
print("The Direction with the lowest points is ", DirArray[HighestPoints], "!")
|
||||
Move(DirArray[HighestPoints])
|
||||
#print(Detail_Dict)
|
||||
print(move)
|
||||
#print(move)
|
||||
#print(Ordered_Commands_Backward)
|
||||
|
||||
Reference in New Issue
Block a user