We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Sequencing the Array
Page Index Toggle Pages: 1
Sequencing the Array (Read 175 times)
Sequencing the Array
Dec 9th, 2008, 7:51am
 
i have this code of the array of grouped object which of the last follows the object just before, and the first object has its movement in ramdom. These objects appear when key are typed. But I want to split it into several groups when space bar is pressed,so that each time just the type after the space bar has its movement, and the keys before the space bar becomes as a group. but I dont know how to do that. I tried but not working. PLS help me . Thank you.

if you go to this link, i uploaded the code which is not spliting effect with space bar. to start up, you should type the keyboard.
http://mysite.pratt.edu/~jchu284/class_gp/d14hw01/index.html


Below i will post the code that i tried to make it split into differnt groups but i failed.


.....
 
 for(int sl=1; sl<seq_length; sl++){
 keynow[seq_length]=key_lengthtt;
 key_length=key_lengthtt-key_lengthc[sl-1];
 i=keynow[sl]-keynow[sl-1];
 for(int i=0; i<key_length; i++){
 float dd = dist(loc_x[i],loc_y[i],
 loc_x[(i+1) % key_length],loc_y[(i+1) % key_length]);

....

What i tried to do is to make a group of sequences among the array, but i think i am just not clear how to do it. Could you give help? Thank you.
Page Index Toggle Pages: 1