I have an assignment to optimise a c++ code that prints a tree in ASCII using partial assembly commands. The issue is that I have to take user input and output a tree corresponding to that height e.g:
. #
###
. |
. |
. |
. |
Would be a tree of height six. The smallest height will be 6 and the largest is 40.
I want to take the approach of defining a char array with the branches drawn (height 36) and then another of the base (height 4). How do I take the user defined size and only draw part of the array or assign part of the array to another smaller array?
I've been struggling with this for a while and any help would be much appreciated.