Skip to content

Instantly share code, notes, and snippets.

@thedom85
Created August 29, 2022 15:13
Show Gist options
  • Save thedom85/eb0fb00ff94835c5b7396cc74cc93a01 to your computer and use it in GitHub Desktop.
Save thedom85/eb0fb00ff94835c5b7396cc74cc93a01 to your computer and use it in GitHub Desktop.
Kata js generateShape
//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