Thread: How to draw shapes with only for loops?

  1. #16
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Quote Originally Posted by CplusplusNewb View Post
    Well now I'm completely stumped. Can you please tell me which numbers I switch? I'm really confused.
    If you want to change going from 0 to 9 into going from 9 to 0, then perhaps you should switch 0 and 9.

  2. #17
    Registered User
    Join Date
    Oct 2009
    I improved my code (personally I would say it's really the simplest way to go around doing this, storage of the triangle image, and drawing which is using almost the exact same increment-draw-repeat loop as yours but with a check to see whether to draw a dash or hash)... you can use it if you want to go with 2d arrays or if you don't want to then you can just take this bit:

    for (int column = lastcolumn; column > 0; column--){//draw last column first and first column last, thus flipping the image horizontally

    here's what my code does when I ran it:

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to draw shapes and output?
    By Diablo02 in forum C# Programming
    Replies: 3
    Last Post: 11-20-2007, 07:11 PM
  2. Which is the better way to draw?
    By g4j31a5 in forum Game Programming
    Replies: 16
    Last Post: 01-22-2007, 11:56 PM
  3. Program with Shapes using Virtual Functions
    By goron350 in forum C++ Programming
    Replies: 12
    Last Post: 07-17-2005, 01:42 PM
  4. draw function HELP!!!
    By sunoflight77 in forum C++ Programming
    Replies: 1
    Last Post: 05-10-2005, 11:28 PM
  5. Draw Shapes.
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 08-19-2002, 09:22 AM