Created
August 29, 2022 15:13
-
-
Save thedom85/eb0fb00ff94835c5b7396cc74cc93a01 to your computer and use it in GitHub Desktop.
Kata js generateShape
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
//https://www.codewars.com/kata/59a96d71dbe3b06c0200009c/train/javascript | |
function generateShape(num){ | |
var outcome = ""; | |
for(var i = 0; i < num;i++){ | |
for(var j = 0; j < num;j++){ | |
outcome=outcome+"+"; | |
} | |
outcome=outcome+"\n"; | |
} | |
return outcome; | |
} | |
console.log(generateShape(2)); | |
console.log("++\n++"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment