wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Extra Line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Extra Line" Watch "Extra Line" New topic
Author

Extra Line

Noah Faust
Greenhorn

Joined: Mar 07, 2009
Posts: 26
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?


[Thumbnail for Capture.JPG]


public class Signature {
public static void main (String[] args) { System.print.ln (//insert witty phrase here) }
}
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
This kind of stuff is probably a loop going round one to many times. Are you sure your while exit condition is right?


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Why are your two calculations for "previousy" different, but your two calculations for "previousx" are the same?
Noah Faust
Greenhorn

Joined: Mar 07, 2009
Posts: 26
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Extra Line