Got the depth search and the trunk working
This commit is contained in:
@@ -182,39 +182,19 @@ func FoundGoal():
|
|||||||
func AllObjectsFound():
|
func AllObjectsFound():
|
||||||
if Tree_Array_SetStart != Tree_Array[0]:
|
if Tree_Array_SetStart != Tree_Array[0]:
|
||||||
var CurrentInstructionSet = []
|
var CurrentInstructionSet = []
|
||||||
|
Trunk = CommonElements(AllSetsToGoal[0], AllSetsToGoal[1], AllSetsToGoal[2])
|
||||||
|
print("This is the Trunk ", Trunk)
|
||||||
if Move_Check1 != move:
|
if Move_Check1 != move:
|
||||||
print("We Done!!!!!!!!!!!!!!!!!")
|
print("We Done!!!!!!!!!!!!!!!!!")
|
||||||
print()
|
print()
|
||||||
for n in AllSetsToGoal.size():
|
for n in AllSetsToGoal.size():
|
||||||
print(n ," set is equal to : ", AllSetsToGoal[n] )
|
var placeHolder = []
|
||||||
|
placeHolder = AllSetsToGoal[n]
|
||||||
|
placeHolder.slice(Trunk[-1])
|
||||||
|
print(n ," set is equal to : ", placeHolder )
|
||||||
print()
|
print()
|
||||||
print("The size for ", n, " is: ", AllSetsToGoal[n].size())
|
|
||||||
CurrentInstructionSet.push_back(AllSetsToGoal[n].size())
|
|
||||||
print("The max is: ", (CurrentInstructionSet).max())
|
|
||||||
var key = CurrentInstructionSet.find(CurrentInstructionSet.max())
|
|
||||||
print("THIS IS THE KEY: ")
|
|
||||||
print(AllSetsToGoal[key])
|
|
||||||
print()
|
|
||||||
print("***********************************")
|
|
||||||
for i in AllSetsToGoal.size():
|
|
||||||
if i != key:
|
|
||||||
print("The I value is: ", i)
|
|
||||||
for x in AllSetsToGoal[key]:
|
|
||||||
if AllSetsToGoal[i].find(x) != -1:
|
|
||||||
var test = []
|
|
||||||
test.push_back(AllSetsToGoal[i].find(x))
|
|
||||||
PreTrunk.push_back(test)
|
|
||||||
print(AllSetsToGoal[i])
|
|
||||||
PreTrunk.erase(PreTrunk.min())
|
|
||||||
PreTrunk = PreTrunk.min()
|
|
||||||
#print(PreTrunk[0])
|
|
||||||
Trunk = AllSetsToGoal[key].slice(PreTrunk[0]+1)
|
|
||||||
print("This is the trunk: ")
|
|
||||||
print(Trunk)
|
|
||||||
print("Test Print ^^^")
|
|
||||||
Move_Check1 = move
|
Move_Check1 = move
|
||||||
|
|
||||||
|
|
||||||
func Mark(Prev_Direction):
|
func Mark(Prev_Direction):
|
||||||
|
|
||||||
var response = ways[IntersectionCounter()]
|
var response = ways[IntersectionCounter()]
|
||||||
@@ -664,6 +644,15 @@ func TypeOfIntersectionHelper():
|
|||||||
else:
|
else:
|
||||||
return "OneDirectionPath"
|
return "OneDirectionPath"
|
||||||
|
|
||||||
|
func CommonElements(A,B,C):
|
||||||
|
var count = []
|
||||||
|
for x in A:
|
||||||
|
#print(x)
|
||||||
|
if x in B:
|
||||||
|
#print(x, " is found in B")
|
||||||
|
if x in C:
|
||||||
|
count.push_back(x)
|
||||||
|
return count
|
||||||
#***** Movement *****
|
#***** Movement *****
|
||||||
|
|
||||||
func goDown():
|
func goDown():
|
||||||
|
|||||||
Reference in New Issue
Block a user