Stormfront's Special AI Thingamajig
Me again. Quick question - if a player wants to build a section of his/her headquarters, then how can I make it so that I have a list of options that aren't repeated?
I've used a 'choice( )' statement for this, but it keeps showing the same option twice or thrice.
I also want to make it so that on the other options (interact, repair, upgrade [excluding end shift]) that it can list the sections you've already built.
Have all your choices in a list:
list = ['bla bla bla', 'lol', 'another choice']
then when you pick one of those choices using random, remove that choice from the list so it won't be picked again
import random choice1 = random.choice(list) list.remove(choice1) choice2 = random.choice(list) list.remove(choice2) # and so on