using loops to create diamon pattern shape

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • janice3
    New Member
    • Mar 2007
    • 7

    #1

    using loops to create diamon pattern shape

    hi.I am a new member in this site.
    today my question is how to make a diamond shape using loops?
    the shape is like:
    Code:
            *
          * * *                              
        * * * * *
      * * * * * * *
    * * * * * * * * *
      * * * * * * *
        * * * * *
           * * *
             *
    Last edited by Ganon11; Mar 1 '07, 10:21 PM. Reason: code tags added to prserve spaces
  • Savage
    Recognized Expert Top Contributor
    • Feb 2007
    • 1759

    #2
    Originally posted by janice3
    hi.I am a new member in this site.
    today my question is how to make a diamond shape using loops?
    the shape is like:
    *
    * * *
    * * * * *
    * * * * * * *
    * * * * * * * * *
    * * * * * * *
    * * * * *
    * * *
    *
    Well the number of stars that create each line must be a odd number.
    You should do it from two parts(Upper and Lower)
    I recommend for loop and somekind of variable,that will raise by two if making upper or descand by two if the lower part is to be made.

    Comment

    • janice3
      New Member
      • Mar 2007
      • 7

      #3
      I created only half diamon(right side)

      <Code Deleted by MOD>

      How can i create left side diamon

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

        Please read the Posting Guidelines and particularly the Coursework Posting Guidlines.

        Then when you are ready post a new question in this thread.

        MODERATOR

        Comment

        • RedSon
          Recognized Expert Expert
          • Jan 2007
          • 4980

          #5
          This is probably one of the most common learning excercises for introductory programming classes. This question has been asked dozens of times on this forum. Have you tried searching for the answers to your questions?

          Comment

          Working...