Results 1 to 6 of 6
  1. #1
    josh2992 is offline Member
    Join Date
    Apr 2011
    Posts
    7
    Rep Power
    0

    Default Making a grid using a String.

    Hey Java Forums,

    I am here because i require a little help. I am trying to write a method that returns a String type and i want the string to be a grid of size that is determined by a seperate variable (ie user input).

    I want the grid to look like so (for a input of 9, refering to a 9x9 grid):

    9 . . . . . . . . . .
    8 . . . . . . . . . .
    7 . . . . . . . . . .
    6 . . . . . . . . . .
    5 . . . . . . . . . .
    4 . . . . . . . . . .
    3 . . . . . . . . . .
    2 . . . . . . . . . .
    1 . . . . . . . . . .
    0 . . . . . . . . . .
    0 1 2 3 4 5 6 7 8 9


    it doesnt really line up properly but basically for a 9x9 grid i need a 9x9 grid complete with numbers to show the user the co-ordinates of each location on the grid.

    I hope im not being too unclear with what i need help with but if you dont understand, please let me know and i will try to explain further. Any help would be much appreciated.

    Thanks.
    Last edited by josh2992; 05-10-2011 at 02:48 PM. Reason: spell check

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,457
    Rep Power
    20

    Default

    You didn't reply to the two useful responses in your last thread.
    How to code a program to send messages to a chat program?

    Not the best way to continue to get help on a forum, that.

    Also, your question lacks one vital detail: is this for console output or a GUI?

    db

  3. #3
    josh2992 is offline Member
    Join Date
    Apr 2011
    Posts
    7
    Rep Power
    0

    Default

    I contacted one of the posters privately because I had trouble understanding him and trouble expressing myself in a short post.

    As to the other part of your post it is a console based program. I'm only just learning and haven't moved to gui's yet so in my head, every program is a console one :p

    Again, any help is appreciated.

  4. #4
    Toll's Avatar
    Toll is offline Senior Member
    Join Date
    May 2011
    Location
    Sweden
    Posts
    393
    Rep Power
    4

    Default

    Can you think of a statement that repeats things?

  5. #5
    josh2992 is offline Member
    Join Date
    Apr 2011
    Posts
    7
    Rep Power
    0

    Default

    so far i am trying to use a for loop with another, nested for loop. I think i am on the right track but my logic is off.

  6. #6
    Toll's Avatar
    Toll is offline Senior Member
    Join Date
    May 2011
    Location
    Sweden
    Posts
    393
    Rep Power
    4

Similar Threads

  1. Grid Painting?
    By iCon09 in forum New To Java
    Replies: 2
    Last Post: 02-26-2011, 08:04 AM
  2. Making a String Array from a text file
    By MrJimmah in forum New To Java
    Replies: 5
    Last Post: 11-17-2010, 12:19 AM
  3. Drawing a grid
    By CrystalMoth in forum Java 2D
    Replies: 11
    Last Post: 01-10-2010, 06:07 AM
  4. Making grid using pictures
    By racewithferrari in forum New To Java
    Replies: 1
    Last Post: 11-01-2009, 01:59 AM
  5. Database Grid
    By leoleo4614 in forum AWT / Swing
    Replies: 1
    Last Post: 12-13-2008, 08:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •