• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extra Line

 
Noah Faust
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I made a program that creates shapes and stars, but I keep getting one extra line whenever I do stars as seen here.
I can't seem to find a straightforward way to fix it that doesn't screw up regular shapes (not stars)
Here is the code:

Any good way to get rid of it?
Capture.JPG
[Thumbnail for Capture.JPG]
 
Martin Vanyavchich
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This kind of stuff is probably a loop going round one to many times. Are you sure your while exit condition is right?
 
Paul Clapham
Sheriff
Pie
Posts: 20729
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are your two calculations for "previousy" different, but your two calculations for "previousx" are the same?
 
Noah Faust
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Paul!, I had changes the window size from 1000x1000 to 700x700, but I must have missed changing the center point (500 to 350) on the very first Y value. It works perfectly now that you caught that.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic