//// People objects (different widths & heights) int many=10; Person p[] = new Person[many]; float horizon; int found=0; int savea, saveb; String news="..."; void setup() { //// Setup: window size, instantiate objects. size( 640, 480 ); horizon= height*3/4; reset(); } void reset() { //// Create several people, 100 pixels apart. float x=50; for (int j=0; j p[w].h ) w=j; } return w; } void swap( Person[] p, int a, int b ) { news= "Swapping "+a+" with "+b+" ah is "+p[a].h +" bh is "+p[b].h; Person tmp= p[b]; p[b] = p[a]; p[a]= tmp; savea= a; saveb= b; } void fattest() { // Move the fattest one to the end. int k= whereFat( p, many ); swap( p, k, many-1 ); // Swap p[k] with p[many] } int whereFat( Person p[], int m ) { //// Return index of fattest int w=0; for ( int j=1; j p[w].pounds() ) w=j; } found=w; //@@@ return w; } void skinniest() { // Move the skinniest one to the end. int k= whereSkinny( p, many ); swap( p, k, many-1 ); // Swap p[k] with p[many] } int whereSkinny( Person p[], int m ) { //// Return index of fattest int w=0; for ( int j=1; j