FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Suggestions
   Software Suggestions
(Moderator: fry)
   case statements
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: case statements  (Read 539 times)
michael

Email
case statements
« on: Dec 12th, 2002, 6:27am »

any thought on including case statements in p5?
 

In the beginning, the universe was created. This made a lot of people very angry, and has been widely regarded as a bad idea.

-- Douglas Adams in The Hitchhiker's Guide to the Universe.
Glen Murphy

WWW Email
Re: case statements
« Reply #1 on: Dec 12th, 2002, 7:21am »

They're already in there - it's Java, so anything Java supports is generally in P5. Crude example below.
 
Code:
int i = 0;
 
void setup() {
  size(100,100);
  }
 
void loop() {
  switch(i%2) {
    case 0:
      background(#000000);
      break;
    case 1:
      background(#ffffff);
      break;
    }
  i++;
  }
« Last Edit: Dec 12th, 2002, 7:21am by Glen Murphy »  
Pages: 1 

« Previous topic | Next topic »