Challenge Set - Triangle Orientation

AceInfinity

Emeritus, Contributor
Joined
Feb 21, 2012
Posts
1,728
Location
Canada
Challenge #1: write a program that will output a triangle like the following:
okwlkKf.png


Where the size of the triangle is defined by N, and N = half the width of the base of the triangle for number of "#"s that exist on the bottom row.

Challenge #2: write a program that will output a triangle like the following:
zi7Rlu2.png


Where the size of the triangle is defined by N, and N = half the width of the base of the triangle for number of "#"s that exist on the bottom row, in addition to M, which defines the width of the spacer in between both halves.

Challenge #3: write a program that will output a diamond like the following:
lDKEWiU.png


Where the size of the diamond is defined by N, and N = half the width of the base of the triangle for number of "#"s that exist on the bottom row (of the top 2 halves of a triangle, minus the vertical spacer), in addition to M, which defines the width of the spacer in between all 4 quadrants of the diamond.

:thumbsup2:
 
Here's my solution for #1 and #2 combined in C++ :)
Read More:

I wrote code for the diamond as well:
Read More:
 
Last edited:

Has Sysnative Forums helped you? Please consider donating to help us support the site!

Back
Top