File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Extra Line

Noah Faust

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?

I no good English.
Paul Clapham

Joined: Oct 14, 2005
Posts: 19973

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

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.
I agree. Here's the link:
subject: Extra Line
It's not a secret anymore!