diff --git a/PlayerScript.gd b/PlayerScript.gd index 7b35843..6d33b9a 100644 --- a/PlayerScript.gd +++ b/PlayerScript.gd @@ -111,7 +111,7 @@ func _input(event): 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(arr2) + CommonsSort(arr1) func _process(delta): FoundGoal() @@ -185,8 +185,6 @@ func AllObjectsFound(): #print(InstancesDict) MakeDescision(0) - MakeDescision(1) - MakeDescision(2) Move_Check1 = move func MakeDescision(marker): @@ -195,6 +193,7 @@ func MakeDescision(marker): for n in AllSetsToGoal: if Keys.find(AllSetsToGoal.find(n)) != -1 or RouteCounter == 0: Arrays.push_back(n[marker]) + print() BestFirst = SmallInstances(Arrays) var Theindex = BestFirst.values().find(BestFirst.values().max()) @@ -203,12 +202,37 @@ func MakeDescision(marker): for n in AllSetsToGoal: if n.find(BestFirst.keys()[Theindex]) != -1: Keys.push_back(AllSetsToGoal.find(n)) - print(Keys) - print("My decision is: ",Decision) - RGoBack(Decision) + + + + #if RouteCounter == 0 or #If what im modifiying is in AllsetsToGo[Keys] + print(CommonsSort(AllSetsToGoal)) print(AllSetsToGoal) - var Temp = AllSetsToGoal - CommonsSort(Temp) + var Temp = [] + for n in AllSetsToGoal.size(): + Temp.append_array(AllSetsToGoal[n]) + print(Temp) + print(CommonsSort) + + + #var Temp = [] + #CommonsSort(Temp) + #if InstancesDict.get(Decision) <= 1: + # print("THIS DECISION IS UNIQUE") + # print(CommonsSort(AllSetsToGoal)) + # for n in AllSetsToGoal.size(): + # Temp.append_array(AllSetsToGoal[n]) + # print(Temp) + # CommonsSort(AllSetsToGoal) + # CommonsSort(Temp) + #else: + # print("THIS ISNT COMMON ") + # CommonsSort(AllSetsToGoal) + + RGoBack(Decision) + + + RouteCounter += 1