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_
   Programming Questions & Help
   Programs
(Moderators: fry, REAS)
   why is this simple app freezing processing?
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: why is this simple app freezing processing?  (Read 420 times)
lunetta

7200475272004752 WWW Email
why is this simple app freezing processing?
« on: May 6th, 2004, 7:02am »

hello p5 companions!
 
I'm testing the get pixels function, but I don't know why something really simple freezes processing everytime (v68 - mac os X)... any ideas?
 
void scheck(int cx, int cy, int cw, int ch)
{
for(int i=cx;i<=(cx+cw);i++) {
  for(int j=cy;i<=(cy+ch);j++) {
    color actual =  get(i,j);
    println(i+"  "+j+"  "+actual);
  }  
}
}
void setup() {
size(200,200);
}
void draw() {
scheck(1,2,3,4);
}
 
it's just an application to get the colors from a certain area...
what's wrong?
 
Thanks!
 
from "the guy with a grand canyon between real world problems and algorithms"
 
TomC

WWW
Re: why is this simple app freezing processing?
« Reply #1 on: May 6th, 2004, 11:08am »

There's an i/j mix-up in your second for loop.  Since i doesn't change once you enter the second loop, you never meet the stop condition.
« Last Edit: May 6th, 2004, 11:09am by TomC »  
lunetta

7200475272004752 WWW Email
Re: why is this simple app freezing processing?
« Reply #2 on: May 6th, 2004, 2:57pm »

DOH!
Sorry guys, I've been not sleeping for a few days...  
dumbest-problem-post-ever award goes to me.
 
By the way, is there any keyboard shortcut to break the application and stop the infinite loop? I was force-quitting processing all the times.
 
 
« Last Edit: May 6th, 2004, 2:59pm by lunetta »  
fry


WWW
Re: why is this simple app freezing processing?
« Reply #3 on: May 6th, 2004, 3:10pm »

on May 6th, 2004, 2:57pm, lunetta wrote:
dumbest-problem-post-ever award goes to me.

nah, everyone makes this error, especially after working too long and/or sleeping too little.
 
well, at least i know i've done it. though usually in c++ where it horks my whole machine.
 
Pages: 1 

« Previous topic | Next topic »