Compare commits

30 Commits

Author SHA1 Message Date
e5f0b13429 origin stuff I was late committing 2024-12-19 08:14:07 -05:00
3df79803fe Doing a rework finally i know how im tackling reroute. It is now in a form of splits instead of every single path aquired which is faster and a little easier for me to comprehend. Going good i left a couple blank spots that need to be fixed like finishing a split and jumping back to the trunk but otherwise going strong. I did implement split detection today and should be a big step up from the dictionary method 2024-11-08 08:12:18 -05:00
bae5ebd549 I figured out the random Dictionary error. PLEASE FIX THE FORMATTING FOR THE ALL SETS TO GOAL ARRAY. After that we are pretty much set. Use the Key array that I convieniently set up that I forgot to use. :( Not alot of progress but I made a blank set for tmr 2024-11-07 08:10:18 -05:00
b4935d5c2d Multiple changes to the refind algo, added a few helper funcs to help out with sorting data, Alot of refactoring to do, fix the sorting algo to work with arrays instead of strs. Also desision marking on best route is done just have to get back to trunk and finish it off. It only works with =< 3 items in the maze needs to keep it less confined to a number and more to an algo 2024-11-02 18:03:54 -04:00
2d1dbe268b Trunk is fully working and the route order is coming along. Route order needs an algo with non-biased to front. Maybe score system but idrk probably score system. Also the reverse thing is done 2024-10-31 08:10:11 -04:00
29b5831c86 Many improvements including common elements search is working along with the trunk deletions. Also instances functions allowing for easy data tracking is done. Fix the full reverse function because data is flipped 2024-10-30 08:13:01 -04:00
d550fca787 Depth search improved with array instead of individual vars. I need to fix trunk system its not working :( 2024-10-29 08:14:15 -04:00
6b05323ded Got the depth search and the trunk working 2024-10-28 08:11:28 -04:00
0eb09a8a1b Trunk proto is done might have to change param because its an inefficient cord 2024-10-25 08:10:42 -04:00
0e0121c3c4 Tree Trunk start 2024-10-24 08:12:10 -04:00
61d38852cd Learning about primary resolve tree. Traversing data with child and parent nodes 2024-10-21 08:11:55 -04:00
40db904a6c Breaking up the Pathfinding algorythm that I would send to the drone!!! Going good so far need to scrape last dataset 2024-10-18 08:09:42 -04:00
6df92902ac Tree Array bug is fixed and Multi array solve needs to add last command before sending to master array 2024-10-16 08:11:39 -04:00
132d7d43c4 Testing Multi object solve. I need to fix Tree array Bug with DE 2024-10-15 08:12:22 -04:00
f3252a4405 Starting the branching for multi-object-solve :) 2024-10-14 08:07:19 -04:00
cfb439deb9 Done with Circles!!!!!! Circles are solves and Recall func is solved. Gonna start on multi solving algo!!! 2024-10-13 13:11:15 -04:00
76cddca5a5 Fixing circle bug with extra dead end data 2024-10-11 08:11:11 -04:00
1722272b79 Fully autonomous maybe a couple more tweaks left 2024-10-10 08:08:52 -04:00
8c977a3e58 Circles are done 2024-10-09 08:11:46 -04:00
f204d72850 Circles are almost done git rid of duplication 2024-10-08 08:13:49 -04:00
5c3bfa56b0 Another Type of circle Solved 2024-10-04 08:09:35 -04:00
b15eaec8be Working on circles 2024-10-03 08:07:52 -04:00
8a35e51d21 CircleAlgo first Part 2024-10-02 08:15:02 -04:00
9dfff400de testing 2024-10-02 07:37:53 -04:00
70777c9f80 Fixing Circles RIght Now!!!!!! 2024-10-01 08:12:41 -04:00
9054a9d80f I fixed the maze 2024-09-28 17:04:46 -04:00
97afe595fb All Intersections point system Algo-Fully Working- 2024-09-28 16:47:46 -04:00
58b24176ab Fixing which move youve directed 2024-09-25 08:11:02 -04:00
c9f5dcd642 No circles for me. Testing the Solvablily 2024-09-23 08:11:21 -04:00
7891ff172f Testing gitg 2024-09-23 07:39:38 -04:00
4 changed files with 234 additions and 524 deletions

View File

@@ -87,57 +87,65 @@ var RouteCounter = 0
var SendToRobo = []
var RetraveledArray = []
var Ori = 0
var Orientations = []
var amnt = 0
func _input(event):
#if Current_Position != TargetCord:
if event.is_action_pressed("ui_left"):
goLeft()
LeftTurn()
Been_There()
AutoBacktrack = false
elif event.is_action_pressed("ui_right"):
goRight()
RightTurn()
Been_There()
AutoBacktrack = false
elif event.is_action_pressed("ui_up"):
goUp()
Been_There()
AutoBacktrack = false
elif event.is_action_pressed("ui_down"):
#goDown()
goingForward()
goDown()
Been_There()
AutoBacktrack = false
elif event.is_action_pressed("ui_accept"):
AutoSolve()
#AutoSolve()
$Sprite2D.rotation_degrees += 180
$Backv.rotation_degrees += 180
$Forwardv.rotation_degrees += 180
$Leftv.rotation_degrees += 180
$Rightv.rotation_degrees += 180
Ori += 180
elif event.is_action_pressed("ui_text_backspace"):
print(Ordered_Commands_Backward)
print()
print(Individual_Steps)
print("**********************************")
print()
print(Tree_Array)
print(SendToRobo)
print(Current_Position)
var arr1 = [['apple', 'orange', 'banana', 'pear', 'fish', 'pancake', 'taco', 'pizza'],['banana', 'pizza', 'fish', 'apple'],['taco', 'fish', 'apple', 'pizza']]
var arr2 = AllSetsToGoal
CommonsSort(arr1)
func _process(delta):
#FoundGoal()
#AllObjectsFound()
Circling()
CallableRaycastData()
Mark(Prev_dir)
WhatMove()
BackTracking()
GiveOrder()
Intersection_Tree()
Circling()
CheckForTreeDeadEnds()
TravelLog()
DeadEndCircles()
CircleRootsAndInts()
SolvinCircleDeadEnds()
#MoveAfterIntersection()
MoveAfterIntersection()
IntersectionWaysAvailable()
IntersectionDumping()
CordsDumping()
FinishCircling()
#print(TrackBack)
#print(Tree_Array)
#print(LogDump)
#print(Orientations)
#Orienting()
#print(Current_Position)
#print(Ordered_Commands_Backward)
#print(Individual_Steps)
func FoundGoal():
if TargetCord.find(Cords[-1]) != -1 and TargetsArray.find(Cords[-1]) == -1:
Goal = true
@@ -359,7 +367,6 @@ func CirclingParody():
if Cicling == false:
print("Found Ya!!!")
print(ManualDistance(Current_Position, Intersections[-1]))
#Current_Position[0] +=1
var addition = []
addition.append_array(LogDump.slice(0,ManualDistance(Current_Position,Intersections[-1])-1))
addition.push_front(Prev_dir_Opp)
@@ -405,23 +412,22 @@ 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)
if Intersections.find(Current_Position) == -1 and Intersections.find(Current_Position) != Intersections.size() -1 and BackTrack_Array.size() >= 2:
TrackBack = GiveOrder()
#Individual_Steps_Opp.push_back(Ordered_Commands_Forward)
Individual_Steps_Opp.push_back(Ordered_Commands_Forward)
#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)
#Individual_Steps.push_front(TrackBack)
if Detail_Dict.Type == "Dead End" and Current_Position != [0,0]:
FlipAround()
print("Done Flipping")
print("Moving")
FullReverseTurn()
print("Done reverse")
GoBack(TrackBack)
GoBack(TrackBack)
print(TrackBack)
Reorient(Intersections.find(Current_Position)-1)
Tree_Array[-1] -= 1
print("Done")
func Circling():
if Been_There_Array.size() > 3:
@@ -435,17 +441,11 @@ 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])
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:
@@ -496,14 +496,12 @@ func Skip():
if CircleInts + 1 == CircleIntsMax:
FirstIntChange()
GoBack(Individual_Steps[0])
Reorient(Intersections.find(Current_Position)-1)
#Individual_Steps.pop_front()
print("First Go To is : ",FirstGoTo)
else:
for n in 2:
print("N is equal to: ",n)
GoBack(Individual_Steps[0])
Reorient(Intersections.find(Current_Position)-1)
#Individual_Steps.pop_front()
print("Needs More WORK!!!!!!!")
print("First Go To is : ",FirstGoTo)
@@ -526,9 +524,7 @@ func FirstIntChange():
FirstGoTo.reverse()
print(Intersections_from_root)
print(Ordered_Commands_Backward)
FlipAround()
GoBack(FirstGoTo)
#Orientations[Intersections.find(Current_Position)-1] = Ori
print(FirstGoTo)
func CircleRootsAndInts():
@@ -551,8 +547,6 @@ func FinishCircling():
if Current_Position == Intersections[-(CircleIntsMax+1)]:
Cicling = false
print("Its On the Root!!!")
Reorient(Intersections.find(Current_Position)-1)
FlipAround()
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
print(Individual_Steps)
@@ -562,16 +556,11 @@ func FinishCircling():
else:
print("Its Off the Root!!!")
Cicling = false
Reorient(Intersections.find(Current_Position)-1)
FlipAround()
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
Reorient(Intersections.find(Current_Position)-1)
FlipAround()
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
print("Its On the Root!!!")
print(Ori)
print(Individual_Steps)
for ints in CircleIntsMax+1:
Tree_Array.pop_back()
@@ -590,17 +579,10 @@ func DeadEndCircles():
func SolvinCircleDeadEnds():
if CircleManualDistance() != null:
FlipAround()
for n in CircleManualDistance() + 1:
print(LogDump[n])
for n in CircleManualDistance():
GoBack(LogDump[n])
Reorient(Intersections.find(Current_Position)-1)
#print(Intersections.find(Current_Position)-1)
print(Orientations)
CircleInts -= 1
FlipAround()
GoBack(Individual_Steps[0])
Reorient(Intersections.find(Current_Position)-1)
Individual_Steps.pop_front()
print(CircleInts)
@@ -623,39 +605,42 @@ func ManualDistance(Start, End):
func Intersection_Tree():
if Cicling == false:
if Cords.find(Current_Position) == -1 or Cords.find(Current_Position) == Cords.size()-1:
if Detail_Dict.Been_There == false:
if Move_Check2 != move:
if Detail_Dict.Type == "3 Way Intersection" and Current_Position != [0,0] and Prev_dir != "R" and Prev_dir != "L":
if Detail_Dict.Type == "3 Way Intersection" and Current_Position != [0,0]:
Tree_Array.push_back(2)
Individual_Steps.push_front(TrackBack)
print(Tree_Array)
print(Intersections)
if Detail_Dict.Type == "4 Way Intersection" and Current_Position != [0,0] and Prev_dir != "R" and Prev_dir != "L":
if Detail_Dict.Type == "4 Way Intersection" and Current_Position != [0,0]:
Tree_Array.push_back(3)
Individual_Steps.push_front(TrackBack)
print(Tree_Array)
print(Intersections)
if Detail_Dict.Type == "Dead End" and Current_Position != [0,0]:
Tree_Array[-1] -= 1
print(Tree_Array)
print(Intersections)
Move_Check2 = move
func CheckForTreeDeadEnds():
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
if Tree_Array.size() > 0:
if Tree_Array[-1] <= 0:
Tree_Array.pop_back()
Tree_Array[-1] -= 1
print(Tree_Array)
GoBack(Individual_Steps[0])
Individual_Steps.pop_front()
else:
pass
func GiveOrder():
if Cicling == false:
Ordered_Commands_Backward.erase("")
Ordered_Commands_Forward.erase("")
#Ordered_Commands_Backward.clear()
if move_check != move:
TrackIntersections()
if Detail_Dict.Been_There == false:
@@ -669,10 +654,9 @@ func GiveOrder():
move_check = move
func TrackIntersections():
if Intersections.find(Current_Position) == -1 and Prev_dir != "R" and Prev_dir != "L":
if Intersections.find(Current_Position) == -1:
if Detail_Dict.Type != "Plain Path" and Detail_Dict.Type != "Dead End":
Intersections.push_back(Current_Position)
Orientations.push_back(Ori)
var Intersections_Copy = Intersections.duplicate(true)
Intersections = Intersections_Copy
@@ -696,7 +680,15 @@ func MoveAfterIntersection():
else:
Invert = false
if Invert == true:
if Invert == true:#print(Direction.find(Dir))
# if Ori == 0 or Ori == 180:
# print("YYYYYYY")
# if Ori == 0:
# print("Same/Normal Orientation")
# print(Dir)
# if Ori == 180:
# print("Flipped")
# print(Direction[Direction.find(Dir)])
#print(Prev_dir_Opp)
IntOptions[-1].erase(Prev_dir_Opp)
#print(IntOptions)
@@ -749,7 +741,7 @@ func IntersectionWaysAvailable():
func Been_There():
if Been_There_Overide == false:
if Cords.find(Current_Position) == -1 or Prev_dir == "L" or Prev_dir == "R":
if Cords.find(Current_Position) == -1 or Prev_dir == "R" or Prev_dir == "L":
Cords.push_back(Current_Position)
Cords_Copy = Cords.duplicate(true)
Cords = Cords_Copy
@@ -761,7 +753,6 @@ func Been_There():
func GoBack(Set):
AutoBacktrack = true
for n in Set:
#await get_tree().create_timer(.25).timeout
Move(n)
func RGoBack(Set):
@@ -802,9 +793,9 @@ func OppData(array):
func RaycastHelper():
var R: bool = $Rightv.is_colliding()
var L: bool = $Leftv.is_colliding()
var F: bool = $Forwardv.is_colliding()
return [R,L,F]
var D: bool = $Forwardv.is_colliding()
var U: bool = $Backv.is_colliding()
return [R,L,U,D]
func FullReverse(data):
var vars = []
@@ -896,168 +887,198 @@ func CommonsSort(Arrays):
return Recount
#***** Movement *****
func FlipAround():
FixOri("Flip")
$Sprite2D.rotation_degrees += 180
$Rightv.rotation_degrees += 180
$Leftv.rotation_degrees += 180
$Forwardv.rotation_degrees += 180
$Backv.rotation_degrees += 180
func Reorient(Index):
print("ORI: ",Ori)
print("Orienting Array: ", Orientations)
var subtractor = Ori
var equ = Orientations[Index]-subtractor
if equ >= 360:
equ -= 360
if equ < 0:
equ += 360
if equ == 90:
Move("R")
if equ == 270:
Move("L")
if equ == 180:
FlipAround()
if equ == 0:
pass
func FixOri(Dir):
if Dir == "R":
Ori += 90
if Dir == "L":
Ori -= 90
if Dir == "Flip":
Ori += 180
if Ori >= 360:
Ori -= 360
if Ori < 0:
Ori += 360
func goForward():
#if not $Forwardv.is_colliding():
if Ori == 0:
self.global_position.y += 24
Current_Position[1] -=1
if Ori == 180:
self.global_position.y -= 24
Current_Position[1] +=1
if Ori == 90:
self.global_position.x -= 24.4
Current_Position[0] -=1
if Ori == 270:
self.global_position.x += 24.4
Current_Position[0] +=1
Prev_dir = "F"
Prev_dir_Opp = "F"
func goingForward():
func goDown():
var D = $Forwardv
dir = Vector2.DOWN
FullCount += 1
if not D.is_colliding():
goForward()
move += 1
#self.global_position.y += 24
#Current_Position[1] -=1
Prev_dir = "F"
Prev_dir_Opp = "F"
move += Move_Strength
Been_There_Overide = false
#Ori = 0
Orienting("D")
else:
Ordered_Commands_Backward.pop_back()
Been_There_Overide = true
move += Move_Strength
print("There is something infront of you")
print("There is something below you")
func goRight():
func goUp():
var U = $Backv
dir = Vector2.UP
if not U.is_colliding():
#self.global_position.y -= 24
#Current_Position[1] +=1
Prev_dir = "F"
Prev_dir_Opp = "F"
move += Move_Strength
Been_There_Overide = false
#Ori = 180
Orienting("U")
else:
Been_There_Overide = true
move += Move_Strength
print("There is something above you")
#BeenTheirFromPrevCord()
FullCount += 1
func RightTurn():
var R = $Rightv
dir = Vector2.RIGHT
if not R.is_colliding():
#self.global_position.x += 24.4
#Current_Position[0] +=1
$Sprite2D.rotation_degrees += 90
$Rightv.rotation_degrees += 90
$Leftv.rotation_degrees += 90
$Forwardv.rotation_degrees += 90
$Backv.rotation_degrees += 90
FixOri("R")
$Sprite2D.rotation_degrees -= 90
$Backv.rotation_degrees -= 90
$Forwardv.rotation_degrees -= 90
$Leftv.rotation_degrees -= 90
$Rightv.rotation_degrees -=90
Prev_dir = "R"
Prev_dir_Opp = "L"
move += 1
#Been_There_Overide = false
move += Move_Strength
Been_There_Overide = false
Ori -= 90
print(Ori)
Orienting("R")
else:
Been_There_Overide = true
move += Move_Strength
print("There is something to your right")
FullCount += 1
func goLeft():
func LeftTurn():
var L = $Leftv
dir = Vector2.LEFT
if not L.is_colliding():
#self.global_position.x -= 24.4
#Current_Position[0] -=1
$Sprite2D.rotation_degrees -= 90
$Rightv.rotation_degrees -= 90
$Leftv.rotation_degrees -= 90
$Forwardv.rotation_degrees -= 90
$Backv.rotation_degrees -= 90
FixOri("L")
$Sprite2D.rotation_degrees += 90
$Backv.rotation_degrees += 90
$Forwardv.rotation_degrees += 90
$Leftv.rotation_degrees += 90
$Rightv.rotation_degrees +=90
Prev_dir = "L"
Prev_dir_Opp = "R"
move += 1
#Been_There_Overide = false
move += Move_Strength
Been_There_Overide = false
Ori += 90
Orienting("L")
else:
Been_There_Overide = true
move += Move_Strength
print("There is something to your left")
FullCount += 1
func Orienting(Dir):
var Base = [0,90,180,270]
var Way = ""
var Default = ["U","D","L","R"]
var LOrientation = ["R","L","D","U"]
var ROrientation = ["L","R", "U","D"]
var BOrientation = ["D","U","R","L"]
if Ori < 0:
Ori = 360 + Ori
if Ori >= 360:
Ori = Ori - 360
#print(Dir)
#print(Ori)
if Ori == 270:
if Dir == "U":
self.global_position.x -= 24.4
Current_Position[0] -=1
if Dir == "D":
self.global_position.x += 24.4
Current_Position[0] +=1
if Dir == "F":
self.global_position.x += 24.4
Current_Position[0] +=1
if Ori == 180:
if Dir == "U":
self.global_position.y += 24
Current_Position[1] -=1
if Dir == "D":
self.global_position.y -= 24
Current_Position[1] +=1
if Dir == "F":
self.global_position.y -= 24
Current_Position[1] +=1
if Ori == 90:
if Dir == "U":
self.global_position.x += 24.4
Current_Position[0] +=1
if Dir == "D":
self.global_position.x -= 24.4
Current_Position[0] -=1
if Dir == "F":
self.global_position.x -= 24.4
Current_Position[0] -=1
if Ori == 0:
if Dir == "U":
self.global_position.y -= 24
Current_Position[1] +=1
if Dir == "D":
self.global_position.y += 24
Current_Position[1] -=1
if Dir == "F":
self.global_position.y += 24
Current_Position[1] -=1
#***** Auto Movement *****
func Move(SetDirection):
if SetDirection == "R":
$Sprite2D.rotation_degrees += 90
$Rightv.rotation_degrees += 90
$Leftv.rotation_degrees += 90
$Forwardv.rotation_degrees += 90
$Backv.rotation_degrees += 90
FixOri("R")
$Sprite2D.rotation_degrees -= 90
$Backv.rotation_degrees -= 90
$Forwardv.rotation_degrees -= 90
$Leftv.rotation_degrees -= 90
$Rightv.rotation_degrees -=90
Ori -= 90
Prev_dir = "R"
Prev_dir_Opp = "L"
move += 1
move += Move_Strength
Been_There()
FullCount += 1
if SetDirection == "L":
$Sprite2D.rotation_degrees -= 90
$Rightv.rotation_degrees -= 90
$Leftv.rotation_degrees -= 90
$Forwardv.rotation_degrees -= 90
$Backv.rotation_degrees -= 90
FixOri("L")
$Sprite2D.rotation_degrees += 90
$Backv.rotation_degrees += 90
$Forwardv.rotation_degrees += 90
$Leftv.rotation_degrees += 90
$Rightv.rotation_degrees +=90
Ori += 90
Prev_dir = "L"
Prev_dir_Opp = "R"
move += 1
move += Move_Strength
Been_There()
FullCount += 1
if SetDirection == "F":
goForward()
move += 1
if SetDirection == "D":
self.global_position.y += 24
Current_Position[1] -=1
Prev_dir = "D"
Prev_dir_Opp = "U"
Prev_dir = "F"
Prev_dir_Opp = "F"
move += Move_Strength
Been_There()
FullCount += 1
if SetDirection == "U":
if SetDirection == "F":
self.global_position.y -= 24
Current_Position[1] +=1
Prev_dir = "U"
Prev_dir_Opp = "D"
Prev_dir = "F"
Prev_dir_Opp = "F"
move += Move_Strength
Been_There()
FullCount += 1
Been_There()
func RMove(SetDirection):
@@ -1097,51 +1118,35 @@ func RMove(SetDirection):
Been_There()
FullCount += 1
func FullReverseTurn():
$Sprite2D.rotation_degrees += 180
$Backv.rotation_degrees += 180
$Forwardv.rotation_degrees += 180
$Leftv.rotation_degrees += 180
$Rightv.rotation_degrees += 180
Ori += 180
func AutoSolve():
var DirectionStrengths = [6 ,6,12]
var DirectionStrengths = [6,6,5,6]
var Colliders = RaycastHelper()
var DirArray = ["R","L","F"]
var Turns = ["R","L"]
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 DirArray = ["R","L","U","D"]
var DumpDuplicate = LogDump
var cp = Current_Position
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]
for n in DirectionStrengths.size():
var MoveScore = DumpDuplicate.rfind(DirArray[n])
if Colliders[n] == true:
DirectionStrengths[n] -= 5000
if DirArray[n] == "R" or DirArray[n] == "L":
if Turns.find(Prev_dir) != -1:
#print("Kill turns")
DirectionStrengths[n] -= 2500
#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
DirectionStrengths[n] -= 1000
if DirArray.find(Prev_dir_Opp) == n:
DirectionStrengths[n] -= 50
if Individual_Steps.size() < 1 and Ordered_Commands_Backward.size() > 1:
if Ordered_Commands_Backward[0] == DirArray[n]:
DirectionStrengths[n] -= 25
if Individual_Steps.size() >= 1:
elif Individual_Steps.size() >= 1:
var Wayback = Individual_Steps[0]
if Wayback[0] == DirArray[n]:
DirectionStrengths[n] -= 25
@@ -1160,11 +1165,8 @@ func AutoSolve():
#if Cicling == true:
# print("ITS CIRCLING DO SOME MODS")
# print(IntOptions )
var HighestPoints = DirectionStrengths.find(max(DirectionStrengths[0],DirectionStrengths[1],DirectionStrengths[2]))
AutoBacktrack = false
var HighestPoints = DirectionStrengths.find(max(DirectionStrengths[0],DirectionStrengths[1],DirectionStrengths[2],DirectionStrengths[3]))
print(DirectionStrengths)
print("The Direction with the lowest points is ", DirArray[HighestPoints], "!")
Move(DirArray[HighestPoints])
#print(Detail_Dict)
#print(move)
#print(Ordered_Commands_Backward)

300
main.tscn

File diff suppressed because one or more lines are too long

View File

@@ -10,9 +10,9 @@ config_version=5
[application]
config/name="MazeAlgoWithOrientation"
config/name="Project Forum Sim"
run/main_scene="res://main.tscn"
config/features=PackedStringArray("4.2", "GL Compatibility")
config/features=PackedStringArray("4.3", "GL Compatibility")
config/icon="res://icon.svg"
[rendering]

View File

@@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://bcuo3byxygxyi"]
[ext_resource type="Texture2D" uid="uid://crkasykc6x5i" path="res://Jump (32x32).png" id="1_ul47s"]
[ext_resource type="Texture2D" uid="uid://q4fvqt4hhr86" path="res://Jump (32x32).png" id="1_ul47s"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_yoddx"]
size = Vector2(33, 52)