Page 1 of 1

Print Grid in Java

Posted: Fri Sep 11, 2015 2:46 pm
by Xaos
Hey guys, sorry I haven't been posting as much. Been super busy with life and school :D

I am doing a project for my Software Development class and I'm having an issue. I'm trying to print a grid in Java using a 2D array. I know the length of the rows and the length of the columns. Everything works fine, except I need to have the borders of the grid print *. It all works okay, the top and bottom and the left work fine. However, the right side of the grid is basically cut in half.

**********
* *
* *
* *
* *
***********

So it basically looks like that. The part that should be in the right column appears directly in the center of the grid, rather than on the right side. I'm basically using two for loops, checking if the first for loop variable equals 0 and the max row, and that is the top and bottom. Then I'm checking if the second checks as 0 or the max column, and that's the left and right columns. I'm not allowed to post specific code but I can questions like this. Any of you guys got any ideas to what is causing this/anything that can point me towards the right direction?

Re: Print Grid in Java

Posted: Mon Feb 01, 2016 4:07 pm
by Chris
Can't help without code.

Re: Print Grid in Java

Posted: Mon Feb 01, 2016 6:44 pm
by hallsofvallhalla
yup need some code to see what is going on.