Ejemplo n.º 1
0
def UpdateLocations(locations):
    temp = ""
    os.system('cls||clear')

    while temp != "Q" or temp != "q":
        choice = False

        print("How would you like to update the list\n")
        print("1 - Add 1 new location")
        print("2 - Take away 1 location")
        print("3 - I want to add a butt load of locations")
        print("4 - Change the co-ordinates of all the locations randomly")
        print("5 - Reset list")
        print("Q - Go back")

        temp = input()
        os.system('cls||clear')

        if temp == "1":
            locations = ListFunctions.AddCity(locations)
            choice = True

        if temp == "2":
            locations = ListFunctions.TakeAwayCity(locations)
            choice = True

        if temp == "3":
            locations = ListFunctions.AddButtLoads(locations)
            choice = True

        if temp == "4":
            locations = ListFunctions.RandomCoordinates(len(locations))
            choice = True

        if temp == "5":
            locations = ListFunctions.ResetList()
            choice = True

        if temp == "Q" or temp == "q":
            return locations

        if choice == False:
            print("Command not recognised, enter a number between 1 and 4\n")