Art of Problem Solving

User:Anand.oza: Difference between revisions

Anand.oza (talk | contribs)
No edit summary
Anand.oza (talk | contribs)
No edit summary
Line 10: Line 10:
for(int j=0; j < c[i].length; ++j) {
for(int j=0; j < c[i].length; ++j) {
  dot((i,j),rgb(red[c[i][j]], gre[c[i][j]], blu[c[i][j]]));
  dot((i,j),rgb(red[c[i][j]], gre[c[i][j]], blu[c[i][j]]));
}
}
</asy>
<asy>unitsize(0.01cm);
real[] red = {1, 0, 0, 0};
real[] gre = {0, 0, 1, 0};
real[] blu = {0, 1, 0, 0};
defaultpen(0.5bp);
for(int i=0; i < 256; ++i) {
for(int j=0; j < 256; ++j) {
dot((i,j),rgb(red[0], gre[0], blu[0]));
}
}
}
}
</asy>
</asy>

Revision as of 16:08, 26 September 2009

[asy]unitsize(1cm); int[][] c = {{0,2,2,0,0,0},              {0,1,1,1,1,0},              {3,3,3,0,0,0}}; real[] red = {1, 0, 0, 0}; real[] gre = {0, 0, 1, 0}; real[] blu = {0, 1, 0, 0}; defaultpen(1bp); for(int i=0; i < c.length; ++i) { for(int j=0; j < c[i].length; ++j) {  dot((i,j),rgb(red[c[i][j]], gre[c[i][j]], blu[c[i][j]])); } } [/asy]

[asy]unitsize(0.01cm); real[] red = {1, 0, 0, 0}; real[] gre = {0, 0, 1, 0}; real[] blu = {0, 1, 0, 0}; defaultpen(0.5bp); for(int i=0; i < 256; ++i) { for(int j=0; j < 256; ++j) {  dot((i,j),rgb(red[0], gre[0], blu[0])); } } [/asy]