Created
June 15, 2019 16:21
-
-
Save Emiton/d47e27825cf2aba86e1db1401ab167ce to your computer and use it in GitHub Desktop.
First help session with Wilfred, mario less
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## . - 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