It won’t (using your example explicitly) but in general what you’ve discovered is that:
- Variables hold values
- Some of those values are references to shared mutable objects.
Lists fall into the second category. There are ways to copy lists if you want distinct behaviour.
list2 = list1[:]
will perform a “shallow copy”. If you have a list of lists, however, the nested lists are still shared references. There is copy.deepcopy
available to make a complete clone of something (including all its nested members).
Start with the core gameplay loop. Look for the fun. Look for what you can take out, not add.
Play-testing something like this with pencil and paper first might be a good idea. Once you work out why it always plays the same way, then you can look for how to perturb the gameplay.