Changeset 1226:71fcebd3a041 in lemon-0.x for src/work
- Timestamp:
- 03/18/05 07:00:20 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1646
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/peter/canvas-test.cc
r1225 r1226 172 172 173 173 Gnome::Canvas::Points coos; 174 for(int i=0;i<numofcoos;i++) 175 { 176 coordinates[i]=coosarray[i++]; 174 for(int i=0;i<numofcoos;i+=2) 175 { 177 176 coordinates[i]=coosarray[i]; 178 coos.push_back(Gnome::Art::Point(coordinates[i-1], coordinates[i])); 179 180 x_wp+=coordinates[i-1]; 181 y_wp+=coordinates[i]; 177 coordinates[i+1]=coosarray[i+1]; 178 coos.push_back(Gnome::Art::Point(coordinates[i], 179 coordinates[i+1])); 180 181 x_wp+=coordinates[i]; 182 y_wp+=coordinates[i+1]; 182 183 183 184 } … … 247 248 int main(int argc, char *argv[]) 248 249 { 249 if((argc>=7)&& ( (argc/2)!=( (argc+1)/2 )) )250 if((argc>=7)&& (argc%2) ) 250 251 { 251 252 double * coosarray=new double[argc]; … … 254 255 { 255 256 coosarray[i-1]=atof(argv[i]); 257 printf("%g%c",coosarray[i-1],i%2?' ':'\n'); 256 258 } 257 259
Note: See TracChangeset
for help on using the changeset viewer.