You are on page 1of 1

Stella Connaughton

Explanations
Lists and arrays are ways of programming many objects in less code. It is more
efficient than programming every object individually, as it takes less time and
space. For example, a program showing a school of fish would be more efficient as a
list or array, rather than individually program every fish to move. They should be
used when needing to program many objects in a similar fashion.
In Alice, to create lists and arrays, you go to create new variable and check
make a list or array. You then are able to designate objects as item0, item1 and
so on. You are able to use two control statements with lists and arrays. First, For All
Together, you can program every single object to perform an action at the same
time. For example, a swarm of bees moving forward would need a For All Together
statement, because they would all move the same way. The other statement is For
All in Order. One would use a For All in Order statement when they want each
object to do a certain method one at a time. For example, if somebody wanted to
make a program of cars moving one by one on a street, they would use a For All in
Order statement.
Lists and arrays both serve the same purpose. They are both data structures.
Their primary goal is to allow the user to program multiple objects in less code.
Arrays and lists index objects from 0-9. However, lists are more expendable. While
arrays have fixed # of items when you first initialize an array, you can add or
remove objects in an array. Additionally, elements in an array are ordered, but
elements in a list are not. However, due to this reason, arrays are often more
efficient, as they are not as complex and will not take up as much memory as a list
would. There are also 2 types of arrays; visual and nonvisual.

You might also like