Skip to content

Instantly share code, notes, and snippets.

@Emiton
Created June 15, 2019 16:21
Show Gist options
  • Select an option

  • Save Emiton/d47e27825cf2aba86e1db1401ab167ce to your computer and use it in GitHub Desktop.

Select an option

Save Emiton/d47e27825cf2aba86e1db1401ab167ce to your computer and use it in GitHub Desktop.
First help session with Wilfred, mario less
## . - 1
### . - 2
#### . - 3
##### - 4
1 - 2# 3""
2 - 3# 2""
3 - 4# 1""
4 - 5#
H = 1
# #
H = 2
_ # #
# # #
H = 3
_ _ # #
_ # # #
# # # #
H = 4
_ _ _ # #
_ _ # # #
_ # # # #
# # # # #
1 extra hashtag for every level
#include <stdio.h>
int main(void)
{
int number[5] = {1,2,3,4,5};
char letters[5] = {'a','b','c','d','e'};
for(int i = 0; i < 5; i++)
{
printf("%i -- %c", number[i], letters[i]);
printf("\n");
}
}
// get height
// for loop
// for everyline print HEIGHT + 1 number of characters
// print out spaces for line
// for loop
// We always print out HEIGHT + 1 characters on everyline
// Number of hashtags is current height and one more
// If there are spaces, they decrease everyline
// Last line has no spaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment