Created
March 19, 2019 19:51
-
-
Save marsrvr/a0d8af627c9e7ae5af4da85a605f1c74 to your computer and use it in GitHub Desktop.
IvanOnTech Smart Contract Programming Course, Eloquent JavaScript Chapter 2, Problem 1: Create an n-tall/wide tree from a pattern (nominally '#'s)
This file contains 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
function recursetree(pattern, endlevel ) { | |
// Create an n-tall/wide tree from a pattern (nominally '#'s) | |
// Recursive solution by Bob Clark 3/19/19 | |
console.log(pattern); | |
if (pattern.length < endlevel) { | |
recursetree(pattern + '#', endlevel); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment