Results 1 to 4 of 4
  1. #1
    EmmCeeVee is offline Member
    Join Date
    Jul 2011
    Posts
    1
    Rep Power
    0

    Default Help with for loop

    I need to make a diamond out of character with a pattern of 1,3,5,3,1.

    right now my diamond looks like this

    ...,
    ..,,
    .,,,
    ,,,,
    .,,,
    ..,,
    ...,

    * where . is a space and , is a char.

    Could anyone teach me how to make my nested loop increase the character output by 2 each time instead of 1.

    All my spacing is right i just need to add some char values.

  2. #2
    return is offline Member
    Join Date
    Jul 2011
    Posts
    11
    Rep Power
    0

    Default

    Have you tried writing it? What have you got so far? Pls share what you have and then maybe we can make suggestions.

    Rose

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    how to make my nested loop increase the character output by 2 each time instead of 1
    If you use the print (vs println) you can print as many characters on a line as you need.

    i just need to add some char values.
    A char value is specified by putting the character in single quotes: 'a'

  4. #4
    aviolently is offline Member
    Join Date
    Jun 2011
    Posts
    23
    Rep Power
    0

    Default

    try this...

    System.out.println(" //what ever you wanna put here ,, even though with space.. this is like a toString() method ")

Similar Threads

  1. JTextField loop 2x for-loop WEIRD!
    By Streetproject in forum AWT / Swing
    Replies: 2
    Last Post: 02-16-2011, 05:46 PM
  2. [Q] Loop issue (while loop)
    By iriscience in forum New To Java
    Replies: 9
    Last Post: 01-31-2011, 04:21 PM
  3. Replies: 5
    Last Post: 04-30-2010, 05:05 PM
  4. while-loop stopping on first loop
    By davester in forum New To Java
    Replies: 6
    Last Post: 06-26-2009, 08:46 PM
  5. A loop that doesn't loop
    By MichYer in forum New To Java
    Replies: 2
    Last Post: 07-30-2007, 08:44 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
  •