Difference between revisions of "Processing"

From Wikicliki
Jump to: navigation, search
Line 11: Line 11:
 
* long - very large non-floating point numbers.
 
* long - very large non-floating point numbers.
  
* arrays  
+
 
 +
* arrays:
 
<pre>
 
<pre>
 
int[] numbers = new int[3];
 
int[] numbers = new int[3];
Line 17: Line 18:
 
numbers[1] = 29;
 
numbers[1] = 29;
 
numbers[2] = 10
 
numbers[2] = 10
 +
// the name of the array is numbers. the square brackets is what indicates its an ARRAY
 +
 +
int arr[] = {1,2,3};
 +
int arr[3] = {1,2,3};
 +
// both these are fine, array does not need number length assigned
 
</pre>
 
</pre>
 +
 +
  
  
 
[[Category:Programming]]
 
[[Category:Programming]]

Revision as of 14:15, 9 April 2010

"Processing is an open source programming language and environment for people who want to program images, animation, and interactions."

Notes

  • int - integer. they can be signed (neg and positive) or unsigned (all positive) values. unsigned values can hold larger values than signed values because the unsigned values have to have an extra bit in front to store whether the number is positive or negative.
  • float - floating point numbers which have decimal place - used to approximate analog and continuous values
  • char - character or letters. but note that although you CAN add them, a+b wont equal ab or c or what you probly expect.
  • boolean - true/false values. in c++ its bool. true and false thusly are reserved words.
  • string - sequence of characters
  • byte - datatype for bytes (8 bits of information storing numerical values) info that cant be stored by other strings or other numbers
  • long - very large non-floating point numbers.


  • arrays:
int[] numbers = new int[3];
numbers[0] = 122;
numbers[1] = 29;
numbers[2] = 10
// the name of the array is numbers. the square brackets is what indicates its an ARRAY

int arr[] = {1,2,3};
int arr[3] = {1,2,3};
// both these are fine, array does not need number length assigned