/** 
 *		(Short description - used in indexlists) 
 * 
 *		sc_testfile.pde 
 * 
 *		(Multiple line detailed description.) 
 *		(The handling of line breaks and HTML is up to the renderer.) 
 *		(Order: short description - detailed description - doc tags.) 
 * 
 * 
 *		@author 		Florian Jenett - mail a) florianjenett.de 
 * 
 *		created:		29.04.2005 - 23:49 Uhr 
 *		modified:		-last-modified- 
 * 
 *		@since 			-since-version- 
 *		@version 		.01 
 * 
 *		@see			-extends- 
 * 
 */ 
 
 
 
// ---- ---- KNOWN PROBLEMS ---- ---- // 
 
// encodings, see: 
// http://processing.org/discourse/yabb/YaBB.cgi?board=Integrate;action=display;num=1096469734;start=8 
println("ŸšŠ †…€ ‰ž™ ‘ ¿"); 
// should be: 
println("üöä ÜÖÄ âêûô ë ø"); 
 
 
// there's a problem with for (..), do (..), .. 
for (int i=0; i<100; i++) {;} 
	 
for( int ii=0; ii<100; ii++) {;} 
 
do {;} while (true) 
 
switch ( true ) 
{ 
	case true: 
		break; 
	case false: 
		break; 
	default: 
} 
 
 
// numbers in strings seam not to be correct: 
String n_str = ".8 6.7 5f 309."; 
n_str = "SHOULD BE SAME COLOR AS THIS"; 
 
 
// ---- ---- COMMENTS ---- ---- // 
 
//	simple comment                
 
/* 
	multi line comment 
*/ 
 
/* 
 * abcd 1234 *-=()/&% 
 * 
 * 
 */ 
 
 
// ---- ---- STRINGS 'N' CHARS ---- ---- // 
 
// string's in comments used to be a "problem" .. no more 
/* error's are "important" in development */ 
char cstr = 'c'; 
 
// string with escapes 
char cstrA = '\''; 
 
String someother  = "\" ' "char   someotherB = '"'; 
 
// "" and '' used to be a problem 
String cstr2 = "String cstr2 = \" "String cstr2A = ""+cstr2; 
String t = "Test"String[] sarr = {"", " ", "\"", "'", ""+"", "\"+\""}; 
 
 
// ---- ---- ... ---- ---- // 
 
final int WHAT_A_VALUE=0public static void main (String[] args){} 
 
 
// ---- ---- NAMEING ---- ---- // 
 
int number123; 
int n123umber; 
int _1_; 
Object aclass; 
Object classic; 
Object implementsAll; 
Object instanceofMe; 
Object $dollar; 
Object _mAdNaM1nK; 
String ss = new java.lang.String(); 
 
 
// ---- ---- NAME, NUMBER or MATH ? ---- ---- // 
 
void name_number_math () { 
float   f1 = .90double  d1 = 23.01    ; 
        f1 = 10.0fint     i1 = 1000     ; 
        f1 = 1000.012 ; 
        f1 = 0.0Object       a1000    ; 
Object       _1000    ; 
Object       a10f     ; 
  
//             10000a 
//             acb0.0 
//             00foll 
 
int alpha = 0println(  4<<2                           ); 
println(  7*(12<<25+3)/alpha>3^1<10.0-3  ); 
println(  12>=3                          ); 
println(  -123.2                         ); 
println(  5-5                            ); 
println(  4.5/3                          ); 
println(  100%3                          ); 
println(  -1.04E-1                       ); 
} 
 
 
// ---- ---- TYPES ---- ---- // 
 
boolean b; 
float f; 
double d; 
long l; 
short s; 
String st; 
char chr; 
 
// ---- ---- FUNCTIONS ---- ---- // 
 
 
void the5thFunction (String abc, Object[] basket){} 
void yet_another_function_2 (){ 
} 
void _2_() 
{ 
} 
 
 
// ---- ---- PROCESSING ---- ---- // 
 
color c; 
 
float pi  = PI; 
float hpi = HALF_PI; 
float tpi = TWO_PI; 
 
PSound bs; 
PImage bi; 
PFont bf; 
PGraphics bg; 
 
void setup() 
{ 
	size( 100, 100, P3D ); 
	size( 100, 100, OPENGL ); 
	noLoop(); 
	framerate(15); 
	int frmrte = framerate*10; 
} 
 
 
void draw(){ 
 
  // ENVIRONMENT part I 
  rect(0,0, width , height ); 
  smooth(); 
  cursor(); 
  save("test_file_2_delete.tif"); 
  saveFrame(); 
   
  // DATA 
  // conversion 
  int    somei = int(.123); 
  float  somef = float(somei);  
  char   somec = char(somef); 
  byte   someb = byte(somei); 
  // parsing 
  int     listi[] = int(split("8 67 5 309")); 
  float   listf[] = float(split(".8 6.7 5f 309.")); 
  String  lists[] = split("acht siebenundsechzig fŸnf dreihundertneun"); 
  String  reverse = join(listf, " : ", 3, 3); 
  sort(lists); 
  // format 
  String formated = nf(11010.223232, 1, 100); 
   
  // SHAPE 
  // 2D Primitives 
  point(0,0); 
  line(0,0, width , height );  
  triangle(width/2.,0, width,height/2., 0,height/2.); 
  quad(width/3.,0, width,height/3., width/3.,height, 0,height/3. ); 
  //rect(); 
  rectMode(CORNER); 
  rectMode(CENTER); 
  rectMode(CORNERS); 
  ellipse(width/4.,height/4., 3*(width/4.),3*(height/4.)); 
  ellipseMode(CORNER); 
  ellipseMode(CORNERS); 
  ellipseMode(CENTER);  
  ellipseMode(CENTER_RADIUS); 
  curve(0,0 ,0,height, width,0, width,height); 
  bezier(0,0 ,0,height, width,0, width,height); 
  // 3D Primitives 
  box(20); 
  sphere(10); 
  // stroke attribs. 
  strokeWeight(1); 
  //vertex 
  beginShape(POINTS);          endShape(); 
  beginShape(LINES);           endShape(); 
  beginShape(LINE_STRIP);      endShape(); 
  beginShape(LINE_LOOP);       endShape(); 
  beginShape(TRIANGLES);       endShape(); 
  beginShape(TRIANGLE_STRIP);  endShape(); 
  beginShape(QUADS); 
    vertex(20, 20); 
    vertex(40, 20); 
    vertex(40, 40); 
    vertex(60, 40); 
    vertex(60, 60); 
    vertex(20, 60); 
  endShape(); 
  beginShape(QUAD_STRIP); 
    curveVertex(84,  91);  
    curveVertex(84,  91);  
    curveVertex(68,  19);  
    curveVertex(21,  17);  
    curveVertex(32, 100);  
    curveVertex(32, 100); 
  endShape(); 
  beginShape(POLYGON); 
    bezierVertex(30, 20);  
    bezierVertex(80, 0);  
    bezierVertex(80, 75);  
    bezierVertex(30, 75); 
  endShape(); 
   
  // INPUT / OUTPUT part I 
  // time 
  millis(); 
  second(); 
  minute(); 
  hour(); 
  day(); 
  month(); 
  year(); 
  // test output 
  println( "println();" ); 
  print( "print();" ); 
  // files 
 
} 
void loop(){ 
 
  // ENVIRONMENT part II 
  framerate(); 
  delay(1000); 
  noSmooth(); 
  noCursor(); 
 
} 
 
  // INPUT / OUTPUT part II 
  // mouse 
void mousePressed(){ 
  println(  mouseX  ); 
  println(  mouseY  ); 
  println(  pmouseX  ); 
  println(  pmouseY  ); 
  println(  mousePressed  ); 
} 
void mouseReleased(){} 
void mouseMoved(){} 
void mouseDragged(){} 
  // keyboard 
void keyPressed(){} 
void keyReleased(){ 
  println(  key  ); 
  println(  keyPressed  ); 
} 
void videoEvent(){} 
 
class aclass 
extends cclass 
implements bclass 
{ 
  private Object foo(){ 
    return null; 
  } 
  public Object foo2(){return this;} 
} 
 
class cclass {} 
interface bclass {}