Advertisement
2insanepeople

Circle gen

Sep 28th, 2014
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.31 KB | None | 0 0
  1. int radius = 500;
  2.  
  3. if (radius > 0)
  4. {
  5.     for(x=(radius*-1); x<radius; x++)
  6.     {
  7.         for(y=(radius*-1);y<radius;y++)
  8.         {
  9.             if((x*x + y*y) < radius*radius && (x*x + y*y > (radius-1*(radius-1))))
  10.                 pixel.setcolor(red);
  11.             else
  12.                 pixel.setcolor(blue);
  13.         }
  14.     }
  15. }
  16. else
  17.     print("Error: radius must be positive");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement