Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

deutsche Version

https://processing.org/tutorials/arrays/

An array is a container that holds a fixed number of values, a bit like a spreadsheet table. With arrays we can store multiple variables of the same type, and access them easily.

Code Block
int[] valueArray;  
valueArray = new int[10];
println(valueArray.length);
 
for(int i=0; i < valueArray.length; i++) {
   valueArray[i] = i * 2;
 }
println(valueArray);

...

Code Block
ArrayList<Integer> numberListvalueList;
 
numberListvalueList = new ArrayList<Integer>();
println(numberListvalueList.size());
 
for(int i=0;i < 10;i++) {
   numberListvalueList.add(i * 2);
 }
println(numberListvalueList);
// fancy things we can do with lists, but not arrays numberList
valueList.add(100);
println(numberListvalueList.size());
println(numberListvalueList);
 
numberListvalueList.remove(0);
println(numberListvalueList.size());
println(numberListvalueList);

println(numberListvalueList.get(0));

Unlike arrays, ArrayLists can only be one dimension.

...

Create a sketch with a selection of graphics randomly distributed on the screen. Code your example so the mouse can control the position of these random points with a Parallax effect (pseudo 3D). Use the mouse click to change the random distribution of the graphics. 

...