• Post Reply Bookmark Topic Watch Topic
  • New Topic

loop with a circle and make a pyrmaid  RSS feed

 
aaron butcher
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


like
x
xx
xxx
xxxx
xxxxx

but with the circles drawn
 
Carey Brown
Saloon Keeper
Posts: 3323
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did class Ellipse come from?
 
Campbell Ritchie
Marshal
Posts: 56553
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But you are creating the Ellipse object with fixed coordinates. You would need to work out how to make the ellipses appear in different locations, which means different coordinates.
As you go through the loop, the coordinates of the ellipses will increase by their sizes. If you start at (50, 50) and they are 20×20 size, then the next row will start at (50, 70).
 
Carey Brown
Saloon Keeper
Posts: 3323
46
Eclipse IDE Firefox Browser Java MySQL Database VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not a beginner topic but if you want the algorithm to draw circles using print characters google "Bresenham circle algorithm".
 
aaron butcher
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Campbell Ritchie wrote:But you are creating the Ellipse object with fixed coordinates. You would need to work out how to make the ellipses appear in different locations, which means different coordinates.
As you go through the loop, the coordinates of the ellipses will increase by their sizes. If you start at (50, 50) and they are 20×20 size, then the next row will start at (50, 70).


could you give me a bit of example code please
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!