How to draw shapes with only for loops?

This is a discussion on How to draw shapes with only for loops? within the C++ Programming forums, part of the General Programming Boards category; Originally Posted by CplusplusNewb Well now I'm completely stumped. Can you please tell me which numbers I switch? I'm really ...

  1. #16
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    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
    Posts
    12
    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:
    http://filesmelt.com/downloader/over...ed_you_say.png

Page 2 of 2 FirstFirst 12
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, 02:42 PM
  4. draw function HELP!!!
    By sunoflight77 in forum C++ Programming
    Replies: 1
    Last Post: 05-11-2005, 12:28 AM
  5. Draw Shapes.
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 08-19-2002, 10:22 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21