From 2cff522bfb50d55666ccdce6e6594cb73b597033 Mon Sep 17 00:00:00 2001 From: your-github-username Date: Mon, 28 Sep 2020 13:35:16 +0800 Subject: [PATCH 1/3] Number of Characters --- script.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/script.js b/script.js index bbe8a29..bd41f1a 100644 --- a/script.js +++ b/script.js @@ -1,4 +1,13 @@ var main = function (input) { - var myOutputValue = 'hello world'; + var myOutputValue = ''; + + var counter = 0; + + while (counter < input) { + myOutputValue = myOutputValue + '👍'; + + counter = counter + 1; + } + return myOutputValue; }; From 72eb7b3a6ff6709e76746fc9532c75f37b37baca Mon Sep 17 00:00:00 2001 From: your-github-username Date: Tue, 29 Sep 2020 18:16:53 +0800 Subject: [PATCH 2/3] Haruka's homework for drawing untill 4 thumsup --- script.js | 4 ---- 1 file changed, 4 deletions(-) diff --git a/script.js b/script.js index bd41f1a..1dd26b0 100644 --- a/script.js +++ b/script.js @@ -1,13 +1,9 @@ var main = function (input) { var myOutputValue = ''; - var counter = 0; - while (counter < input) { myOutputValue = myOutputValue + '👍'; - counter = counter + 1; } - return myOutputValue; }; From db18b0435353f1a60c9799ea98945d9f0842594e Mon Sep 17 00:00:00 2001 From: your-github-username Date: Wed, 30 Sep 2020 17:47:24 +0800 Subject: [PATCH 3/3] I added square --- script.js | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/script.js b/script.js index 1dd26b0..fb2a69b 100644 --- a/script.js +++ b/script.js @@ -1,9 +1,22 @@ -var main = function (input) { - var myOutputValue = ''; - var counter = 0; - while (counter < input) { +var myOutputValue = ''; + +var lineCounter = 0; + +while (lineCounter < input) { + var columnCounter = 0; + + while (columnCounter < input) { myOutputValue = myOutputValue + '👍'; - counter = counter + 1; + + columnCounter = columnCounter + 1; } - return myOutputValue; + + // start a new line + myOutputValue = myOutputValue + '
'; + + lineCounter = lineCounter + 1; +} + +return myOutputValue; }; +