Code for looping


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Code for looping

  1. #1
    Join Date
    Oct 2002
    Posts
    2

    Code for looping

    Can somebody please help me? I have to create a program which produces a shape on the output screen made up of astrisks, but which is designed with loops in such a way that new values of the parameters can be entered altering the size and appearance of the shape. I've chosen a Greek temple shape with a triangular roof and columns on a base, but I keep messing up. I would be grateful of somone could give me an idea of the kinds of looping structures I would need and how they can be arranged properly.

    Thanks

  2. #2
    Join Date
    Sep 2002
    Posts
    78
    can you show us an example of this "greek temple" like what it looks like, cause i dont get it... i'll try to help out.

    btw 'for' loops own
    ¿Red Baron?
    [code] /* dont forget code tags! */ [/code]
    Come visit the Café!

  3. #3
    Join Date
    Oct 2002
    Posts
    2

    Greek temple

    The aim is for the output to look something like this (it may not come out exactly as I want it; the roof should slope down on both sides):

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

    I would have to create loops to form the roof and then the columns and finally the base. Apart from the main method, there should be another three of four methods.

    Grateful for your help.

  4. #4
    Join Date
    Sep 2002
    Posts
    78
    you can use code tags to keep your formating

    [code]
    Code:
              ***
             *****
            *******
    [/code]

    and also the parameters entered at the beginning of the prog to determine the size of your pic are they like the amount of characters in width and height? or are they like a percentage of a default size?
    ¿Red Baron?
    [code] /* dont forget code tags! */ [/code]
    Come visit the Café!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center