if person.living: inventory.append(person.alive) playerDesires = goal root = EventNode([], playerDesires, [], "LAST", "NULL") # After making all adversaries human, add non human adversaries forest = Adversary("Forest") forest.addInteraction( Interaction("Chopped down a Tree", ["Wood", "Axe"], ["Axe"])) adversaries.append(forest) # Find branches root.expandChildren(adversaries, inventory) # prune branches that are root.verify(inventory) # Prune away branches that can't be completed with our inventory root.eliminateRedundant() # Eliminate branches that contain the same set of actions. arr = root.reversedList() if len(arr) < 3 or len(arr) > 5: # print("Mulligan") pass else: population = "World contains: " for add in adversaries: population = population + add.name + ", " print(population) finished = True print("I STARTED WITH: " + str(physicalInventory)) print("I WANTED: " + str(playerDesires)) count = 1 for i in arr: