warfighter67

Untitled

Oct 29th, 2013
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void triangle::draw()
  2. {
  3.     for(int x = 0; x < leg; x++)
  4.     {
  5.         if(d == LEFT)
  6.         {
  7.             for(int y = 0; y < x + 1; y++)
  8.             {
  9.                 if(x == leg - 1 || y == 0 || y == x)
  10.                 {
  11.                     cout << "+ ";
  12.                 }
  13.                 else
  14.                 {
  15.                     cout << "  ";
  16.                 }
  17.             }
  18.             cout << endl;
  19.         }
  20.         else
  21.         {
  22.             for(int y = 0; y < leg; y++)
  23.             {
  24.                 if(y == leg - 1 || x == leg - 1 || y == leg - x - 1)
  25.                 {
  26.                     cout << "+ ";
  27.                 }
  28.                 else
  29.                 {
  30.                     cout << "  ";
  31.                 }
  32.             }
  33.             cout << endl;
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment