So far we have seen how to make specific objects do one specific action. However, if we had a lot of objects and we wanted to make them do the same thing in order, or at the same time, we would want the computer to make that happen, instead of writing out each line that made each object do the same action.
For example, think of how you would get all of your friends to jump up at the same time for a picture. It would be overkill to tell each friend "When I count to three, jump", and it would make more sense to tell them all at once, "When I count to three, jump!" But you also don't want EVERYONE to jump on the count of three, you only want your friends to jump on the count of three.
With computers we can make lists of objects so that we can have them all perform the same action without having to tell each one to do it. We can even specify if we want them to perform the actions together or one at a time!
It is also not too interesting to always have all the objects do the exact same thing. Think of the jumping picture again, if everyone jumped the exact same height, though it would look really neat, it would not look very natural. When dealing with the same action happening repeatedly (either to lots of objects, in a list, or to the same object lots of times, in a loop) introducing randomness results in a more natural action.
Things you will learn in this module:
Vocabulary:
Lists: A list of objects allows objects to be grouped together so that you can perform the same action on all the items in a list, or so that you can have access to certain objects that have similar properties.
Randomness: We can choose random numbers using a random number generator. Random numbers are useful for making objects do an action with variance, and can be used for choosing random objects too.