Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void triangle::draw()
- {
- for(int x = 0; x < leg; x++)
- {
- if(d == LEFT)
- {
- for(int y = 0; y < x + 1; y++)
- {
- if(x == leg - 1 || y == 0 || y == x)
- {
- cout << "+ ";
- }
- else
- {
- cout << " ";
- }
- }
- cout << endl;
- }
- else
- {
- for(int y = 0; y < leg; y++)
- {
- if(y == leg - 1 || x == leg - 1 || y == leg - x - 1)
- {
- cout << "+ ";
- }
- else
- {
- cout << " ";
- }
- }
- cout << endl;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment