From 950aaff3900437e58de8f5a50bcb1aff0fcca38d Mon Sep 17 00:00:00 2001 From: umikami Date: Fri, 17 Jun 2022 17:25:04 -0400 Subject: [PATCH 01/28] up to 3 exercises --- .DS_Store | Bin 0 -> 6148 bytes .gitignore | 20 ++++++++++++++++++++ .learn/vscode_queue.json | 1 + 01-hello-world/README.es.md | 26 ++++++++++++++++++++++++++ 01-hello-world/README.md | 3 +++ 01-hello-world/app.js | 4 ++++ 01-hello-world/test.js | 7 +++++++ 02-AreaOfTriangle/README.es.md | 7 +++++++ 02-AreaOfTriangle/README.md | 7 +++++++ 02-AreaOfTriangle/app.js | 4 ++++ 02-AreaOfTriangle/test.js | 22 ++++++++++++++++++++++ 03-CompareStrings/README.es.md | 0 03-CompareStrings/README.md | 6 ++++++ 03-CompareStrings/app.js | 1 + 03-CompareStrings/test.js | 15 +++++++++++++++ README.es.md | 4 ++++ README.md | 4 ++++ learn.json | 33 +++++++++++++++++++++++++++++++++ 18 files changed, 164 insertions(+) create mode 100644 .DS_Store create mode 100644 .gitignore create mode 100644 .learn/vscode_queue.json create mode 100644 01-hello-world/README.es.md create mode 100644 01-hello-world/README.md create mode 100644 01-hello-world/app.js create mode 100644 01-hello-world/test.js create mode 100644 02-AreaOfTriangle/README.es.md create mode 100644 02-AreaOfTriangle/README.md create mode 100644 02-AreaOfTriangle/app.js create mode 100644 02-AreaOfTriangle/test.js create mode 100644 03-CompareStrings/README.es.md create mode 100644 03-CompareStrings/README.md create mode 100644 03-CompareStrings/app.js create mode 100644 03-CompareStrings/test.js create mode 100644 README.es.md create mode 100644 README.md create mode 100644 learn.json diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..abdd76a39f390a4aeff86b6db2a1f1b0e71d0c94 GIT binary patch literal 6148 zcmeHKL2DC16n@jjy4xxQQ4pc9&}$QuHVEQnjp@OImu{(tDsi_P>gr}DWH;sz0()0~ zi+6vBe@DMJGleE;v8N(-9=!S9%)D=w`PhB4LqwuGN!vtqBJ$vjwM{ga7|*k>*qR;L z01CZ^q9KharZEjxvfY4Fz$x&rDZtNp10+_k3OntRL13`=*Hs{?j0$W zC+BgT9A|@Rzy9!*l4YF9!B`Wrbbyq1Z!?*yX;)2TT4-)$COqHw`}HTYS);wz>Ffrb z{r&lFFnhk&;`rHo?t71Rp1wHjf6j+eebf6Pfr_T>zQuF+j^J8~eTl|0SMm(`yw)b= zsES-0B{k_2)Kw&xRQ-Xxi>ltELpp%gJ$eIdf?uE=Qo6_!+ebgfgsDX^%(y6M*W{6Dz*{=Z0a zJ*R+E;J;Ep)Ot~`i!Ir+b!BsW)&}qoa5m1X3~CA*dmQV4kK)I0ZI}x<0EQMTgBXFi O9|0|cYn%c%s=yx(cZ;6@ literal 0 HcmV?d00001 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5a19a93 --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# configuration and readme +!.gitignore +!.gitpod.yml +!.gitpod.Dockerfile +!learn.json +!README.md + +# exercises +!.learn/ +!.learn/* +.learn/_app +.learn/.session +.learn/dist +.learn/app.tar.gz +.learn/config.json + +# python compiled files +*.pyc +__pycache__/ +.pytest_cache/ \ No newline at end of file diff --git a/.learn/vscode_queue.json b/.learn/vscode_queue.json new file mode 100644 index 0000000..58509e3 --- /dev/null +++ b/.learn/vscode_queue.json @@ -0,0 +1 @@ +[{"name":"initializing","time":175129340.75},{"name":"reset","time":175129359.416},{"name":"configuration_loaded","time":175133222},{"name":"start_exercise","time":174443594.333,"data":"02-AreaOfTriangle"},{"name":"open_files","time":174448481.541,"data":["02-AreaOfTriangle/app.js"]},{"name":"open_files","time":174692660.958,"data":["02-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":175150820.125,"data":"03-CompareStrings"},{"name":"open_files","time":175157106.375,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174390734.666,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175133106.75,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175085562.583,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174504868.833,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174565310.916,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175069917.166,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174601782.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175152446.708,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174998122.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174399577.666,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175336814.708,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174588032.708,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174916562.625,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174454711.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174728497.625,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175131962.333,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174772987,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175329922.166,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174860770.75,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174867352.916,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174937181.333,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174485081.208,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175056026.666,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175095521,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174928569.958,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174456907.333,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174466553.708,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175328004.666,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175311400.458,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175016122.416,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174838107.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175078291.416,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174509831.458,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174780835.375,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175351647.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175403420.083,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174962067.458,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175202247.916,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174600329.791,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175429568.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175257939.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175242050.291,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175243982.875,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175563987.375,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175102941.208,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175319291.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174645130.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175456348.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174730602.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174902596.583,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175511166.541,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175235145.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174979396.416,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174902875.75,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175403786.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175380266.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175001536.625,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174908615.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175169835.958,"data":["03-CompareStrings/app.js"]}] \ No newline at end of file diff --git a/01-hello-world/README.es.md b/01-hello-world/README.es.md new file mode 100644 index 0000000..fe34a8c --- /dev/null +++ b/01-hello-world/README.es.md @@ -0,0 +1,26 @@ +# `01` Primer Ejercicio + +Hemos creado este primer ejercicio como ejemplo. Lo puedes ubicar en la carpeta `./01-hello-world`. + +1. Cada ejercicio debe estar ubicado en carpetas separadas y debe tener un archivo README.md con las instrucciones del ejercicio escrito en markdown. +2. Puedes tener un archivo README el cual será como una página de un libro, sin archivos de código. +3. También puedes agregar un archivo `README.[lenguaje].md` para traducciones, por ejemplo `README.es.md` para español. + +## Inserta videos + +Si quieres incluir algún video introductorio para cada ejercicio, agrega la propiedad `intro` en el inicio del README.md para ese ejercicio en particular: + +```markdown +--- +intro: "https://www.youtube.com/watch?v=YkgkThdzX-8" +--- +``` + +Tambien puedes agregar un video explicando la solución para cada ejercicio agregando la propiedad `tutorial` al inicio del markdown del README.md correspondiente: + +```markdown +--- +intro: "https://www.youtube.com/watch?v=YkgkThdzX-8" +tutorial: "https://www.youtube.com/watch?v=YkgkThdzX-8" +--- +``` diff --git a/01-hello-world/README.md b/01-hello-world/README.md new file mode 100644 index 0000000..0a2afc4 --- /dev/null +++ b/01-hello-world/README.md @@ -0,0 +1,3 @@ +# `01` 01-Hello-World + +Write a function `helloWorld` that returns `"Hello World"` \ No newline at end of file diff --git a/01-hello-world/app.js b/01-hello-world/app.js new file mode 100644 index 0000000..7bf0a14 --- /dev/null +++ b/01-hello-world/app.js @@ -0,0 +1,4 @@ +// your code here +function helloWorld() { + return "Hello World"; +} \ No newline at end of file diff --git a/01-hello-world/test.js b/01-hello-world/test.js new file mode 100644 index 0000000..b7fa95d --- /dev/null +++ b/01-hello-world/test.js @@ -0,0 +1,7 @@ +const rewire = require("rewire") +const app = rewire('./app.js') + +test('There should be a function called helloWorld', () => { + const total = app.__get__("helloWorld"); + expect(total).toBeTruthy(); +}) \ No newline at end of file diff --git a/02-AreaOfTriangle/README.es.md b/02-AreaOfTriangle/README.es.md new file mode 100644 index 0000000..3b6a54b --- /dev/null +++ b/02-AreaOfTriangle/README.es.md @@ -0,0 +1,7 @@ +# `02` 02-AreaOfTriangle + +Haz que la funcion checkNums(num1,num2) tome lo dos parametros siendo pasados. + +# Instructions 🗒 +1. Retorna `true` si `num2` es mayor que `num1`, de lo contrario retorna `false`. +2. Si los paremetros son iguales retorna `-1`. \ No newline at end of file diff --git a/02-AreaOfTriangle/README.md b/02-AreaOfTriangle/README.md new file mode 100644 index 0000000..da61a06 --- /dev/null +++ b/02-AreaOfTriangle/README.md @@ -0,0 +1,7 @@ +# `02` 02-AreaOfTriangle + +Have the function checkNums(num1,num2) take both parameters being passed. + +# Instructions 🗒 +1. Return true if `num2` is greater than `num1`, otherwise return `false`. +2. If the parameter values are equal to each other then return `-1`. \ No newline at end of file diff --git a/02-AreaOfTriangle/app.js b/02-AreaOfTriangle/app.js new file mode 100644 index 0000000..4b97e77 --- /dev/null +++ b/02-AreaOfTriangle/app.js @@ -0,0 +1,4 @@ +// your code here +function checkNums(num1, num2){ + return num2 > num1 ? true : num1 > num2 ? false : -1; +} \ No newline at end of file diff --git a/02-AreaOfTriangle/test.js b/02-AreaOfTriangle/test.js new file mode 100644 index 0000000..f46d3c0 --- /dev/null +++ b/02-AreaOfTriangle/test.js @@ -0,0 +1,22 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test('There should be a checkNums function', () => { + const checkNums = app.__get__("checkNums"); + expect(checkNums).toBeTruthy(); +}) + +test('If num2 is bigger than num1 you should return true', () => { + const checkNums = app.__get__("checkNums"); + expect(checkNums(4, 23)).toBe(true); +}); + +test("If num2 is less than num1 you should return false", () => { + const checkNums = app.__get__("checkNums"); + expect(checkNums(23, 4)).toBe(false); +}); + +test("If num1 is EQUAL to num2 you should return -1", () => { + const checkNums = app.__get__("checkNums"); + expect(checkNums(5, 5)).toBe(-1); +}); \ No newline at end of file diff --git a/03-CompareStrings/README.es.md b/03-CompareStrings/README.es.md new file mode 100644 index 0000000..e69de29 diff --git a/03-CompareStrings/README.md b/03-CompareStrings/README.md new file mode 100644 index 0000000..52337be --- /dev/null +++ b/03-CompareStrings/README.md @@ -0,0 +1,6 @@ +# `03` 03-ComapreStrings + +Create a function `compareStrings` that takes two strings as arguments. + +# Instructions 🗒 +1. Return either `true` or `false` depending on whether the total number of characters in the first string is equal to the total number of characters in the second string. \ No newline at end of file diff --git a/03-CompareStrings/app.js b/03-CompareStrings/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/03-CompareStrings/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/03-CompareStrings/test.js b/03-CompareStrings/test.js new file mode 100644 index 0000000..8f293f6 --- /dev/null +++ b/03-CompareStrings/test.js @@ -0,0 +1,15 @@ +const rewire = require("rewire") +const app = rewire("./app.js") + +test('Function compareStrings should exist', ()=>{ + const compareStrings = app.__get__("compareStrings") + expect(compareStrings).toBeTruthy(); +}); +test('If the strings have the same length it should be true', ()=>{ + const compareStrings = app.__get__("compareStrings") + expect(compareStrings("hello", "table")).toBe(true); +}); +test('If the strings have the different lengths it should be false', ()=>{ + const compareStrings = app.__get__("compareStrings") + expect(compareStrings("zoo", "spectacular")).toBe(false); +}); \ No newline at end of file diff --git a/README.es.md b/README.es.md new file mode 100644 index 0000000..8473f88 --- /dev/null +++ b/README.es.md @@ -0,0 +1,4 @@ +# Bienvenido a Javascript 10 Challenges +Has inicializado los ejercicios con grading=`incremental`; esto signigica que tus estudiantes completarán un solo tutorial con pasos claros e incrementales, desde el comienzo hasta el final. + +Ejecuta `$ learnpack start` en la terminal para comenzar con los ejercicios. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..57f3d3c --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Welcome to Javascript 10 Challenges +You have initialized the exercises with grading=`incremental`; meaning that your students will complete one single tutorial with clear and autograded steps from beginning to end. + +Type `$ learnpack start` in your terminal to start the exercises. \ No newline at end of file diff --git a/learn.json b/learn.json new file mode 100644 index 0000000..82a5b2b --- /dev/null +++ b/learn.json @@ -0,0 +1,33 @@ +{ + "port": 3000, + "editor": { + "mode": null, + "agent": null, + "version": null + }, + "dirPath": "./.learn", + "configPath": "./learn.json", + "outputPath": "./.learn/dist", + "publicPath": "/preview", + "publicUrl": null, + "language": "auto", + "grading": "isolated", + "exercisesPath": "./", + "webpackTemplate": null, + "disableGrading": false, + "disabledActions": [], + "actions": [], + "entries": { + "html": "index.html", + "vanillajs": "index.js", + "react": "app.jsx", + "node": "app.js", + "python3": "app.py", + "java": "app.java" + }, + "difficulty": "easy", + "duration": 2, + "description": "10 javascript problems to test your knowledge", + "title": "Javascript 10 Challenges", + "slug": "javascript-10-challenges" +} \ No newline at end of file From 49797a5d1d9fe5e93d60a6d8c106d0073ba34318 Mon Sep 17 00:00:00 2001 From: umikami Date: Fri, 17 Jun 2022 18:09:54 -0400 Subject: [PATCH 02/28] added spanish instruction --- 03-CompareStrings/README.es.md | 6 ++++++ 03-CompareStrings/app.js | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/03-CompareStrings/README.es.md b/03-CompareStrings/README.es.md index e69de29..1f19fd9 100644 --- a/03-CompareStrings/README.es.md +++ b/03-CompareStrings/README.es.md @@ -0,0 +1,6 @@ +# `03` 03-ComapreStrings + +Crea una funcion `compareStrings` que toma dos strings como argumentos. + +# Instructions 🗒 +1. Retorna `true` o `false` dependiendo en que el total de caracteres en la primera string sea igual en tamanio al numero de caracters en la segunda string. \ No newline at end of file diff --git a/03-CompareStrings/app.js b/03-CompareStrings/app.js index 851493a..fc789ff 100644 --- a/03-CompareStrings/app.js +++ b/03-CompareStrings/app.js @@ -1 +1,8 @@ -// your code here \ No newline at end of file +// your code here +function compareStrings(string1, string2) { + if (string1.length === string2.length) { + return true + } else { + return false + } +} \ No newline at end of file From bf3fd98ba5596d306e269e22b347da0cc96d1fdc Mon Sep 17 00:00:00 2001 From: umikami Date: Fri, 17 Jun 2022 18:10:19 -0400 Subject: [PATCH 03/28] added new exercise --- 04-DivisibleBy5/README.es.md | 0 04-DivisibleBy5/README.md | 4 ++++ 04-DivisibleBy5/app.js | 4 ++++ 04-DivisibleBy5/test.js | 19 +++++++++++++++++++ 4 files changed, 27 insertions(+) create mode 100644 04-DivisibleBy5/README.es.md create mode 100644 04-DivisibleBy5/README.md create mode 100644 04-DivisibleBy5/app.js create mode 100644 04-DivisibleBy5/test.js diff --git a/04-DivisibleBy5/README.es.md b/04-DivisibleBy5/README.es.md new file mode 100644 index 0000000..e69de29 diff --git a/04-DivisibleBy5/README.md b/04-DivisibleBy5/README.md new file mode 100644 index 0000000..8e0b6c6 --- /dev/null +++ b/04-DivisibleBy5/README.md @@ -0,0 +1,4 @@ +# `04` 04-DivisibleBy5 + +# Instructions 🗒 +1. Create a function that returns `true` if an integer is divisible by `5`, and `false` otherwise. \ No newline at end of file diff --git a/04-DivisibleBy5/app.js b/04-DivisibleBy5/app.js new file mode 100644 index 0000000..d3029b7 --- /dev/null +++ b/04-DivisibleBy5/app.js @@ -0,0 +1,4 @@ +// your code here + function divisibleBy5(int) { + return int % 5 === 0 ? true : false; + } \ No newline at end of file diff --git a/04-DivisibleBy5/test.js b/04-DivisibleBy5/test.js new file mode 100644 index 0000000..cf8b539 --- /dev/null +++ b/04-DivisibleBy5/test.js @@ -0,0 +1,19 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test("Function divisibleBy5 should exist", () => { + const divisibleBy5 = app.__get__("divisibleBy5"); + expect(divisibleBy5).toBeTruthy(); +}); +test("Number should be divisible by 5", () => { + const divisibleBy5 = app.__get__("divisibleBy5"); + //checks if true when divisible by 5 + expect(divisibleBy5(35)).toBe(true); + expect(divisibleBy5(30)).toBe(true); + expect(divisibleBy5(5)).toBe(true); + expect(divisibleBy5(90)).toBe(true); + + // Checks if false when not divisible by 5 + expect(divisibleBy5(14)).toBe(false); + expect(divisibleBy5(26)).toBe(false); +}); From 4c6d1b2e582fc5d3b4ab7ae71cd532649c198b91 Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 18:42:16 -0400 Subject: [PATCH 04/28] Removed hello-world exexercise and added folder for upcoming exercises --- .learn/reports/01-AreaOfTriangle.json | 29 +++++++++++++++++++ .learn/reports/02-CompareStrings.json | 25 ++++++++++++++++ .learn/reports/03-DivisibleBy5.json | 21 ++++++++++++++ .learn/reports/04-VowelCount.json | 21 ++++++++++++++ .../resets/01-AreaOfTriangle}/app.js | 0 .../resets/02-CompareStrings}/app.js | 0 .../resets/03-DivisibleBy5}/app.js | 0 .learn/resets/04-VowelCount/app.js | 8 +++++ .learn/vscode_queue.json | 2 +- .vscode/settings.json | 5 ++++ .../README.es.md | 4 +-- .../README.md | 2 +- 01-AreaOfTriangle/app.js | 4 +++ .../test.js | 0 01-hello-world/README.es.md | 26 ----------------- 01-hello-world/README.md | 3 -- 01-hello-world/app.js | 4 --- 01-hello-world/test.js | 7 ----- .../README.es.md | 4 +-- .../README.md | 2 +- 02-CompareStrings/app.js | 8 +++++ .../test.js | 0 03-DivisibleBy5/README.es.md | 4 +++ .../README.md | 2 +- 03-DivisibleBy5/app.js | 4 +++ {04-DivisibleBy5 => 03-DivisibleBy5}/test.js | 0 04-DivisibleBy5/README.es.md | 0 04-VowelCount/README.es.md | 4 +++ 04-VowelCount/README.md | 4 +++ 04-VowelCount/app.js | 5 ++++ 04-VowelCount/test.js | 15 ++++++++++ 31 files changed, 165 insertions(+), 48 deletions(-) create mode 100644 .learn/reports/01-AreaOfTriangle.json create mode 100644 .learn/reports/02-CompareStrings.json create mode 100644 .learn/reports/03-DivisibleBy5.json create mode 100644 .learn/reports/04-VowelCount.json rename {02-AreaOfTriangle => .learn/resets/01-AreaOfTriangle}/app.js (100%) rename {03-CompareStrings => .learn/resets/02-CompareStrings}/app.js (100%) rename {04-DivisibleBy5 => .learn/resets/03-DivisibleBy5}/app.js (100%) create mode 100644 .learn/resets/04-VowelCount/app.js create mode 100644 .vscode/settings.json rename {02-AreaOfTriangle => 01-AreaOfTriangle}/README.es.md (82%) rename {02-AreaOfTriangle => 01-AreaOfTriangle}/README.md (90%) create mode 100644 01-AreaOfTriangle/app.js rename {02-AreaOfTriangle => 01-AreaOfTriangle}/test.js (100%) delete mode 100644 01-hello-world/README.es.md delete mode 100644 01-hello-world/README.md delete mode 100644 01-hello-world/app.js delete mode 100644 01-hello-world/test.js rename {03-CompareStrings => 02-CompareStrings}/README.es.md (83%) rename {03-CompareStrings => 02-CompareStrings}/README.md (91%) create mode 100644 02-CompareStrings/app.js rename {03-CompareStrings => 02-CompareStrings}/test.js (100%) create mode 100644 03-DivisibleBy5/README.es.md rename {04-DivisibleBy5 => 03-DivisibleBy5}/README.md (83%) create mode 100644 03-DivisibleBy5/app.js rename {04-DivisibleBy5 => 03-DivisibleBy5}/test.js (100%) delete mode 100644 04-DivisibleBy5/README.es.md create mode 100644 04-VowelCount/README.es.md create mode 100644 04-VowelCount/README.md create mode 100644 04-VowelCount/app.js create mode 100644 04-VowelCount/test.js diff --git a/.learn/reports/01-AreaOfTriangle.json b/.learn/reports/01-AreaOfTriangle.json new file mode 100644 index 0000000..99f3f10 --- /dev/null +++ b/.learn/reports/01-AreaOfTriangle.json @@ -0,0 +1,29 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 4, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "There should be a checkNums function", + "status": "passed" + }, + { + "title": "If num2 is bigger than num1 you should return true", + "status": "passed" + }, + { + "title": "If num2 is less than num1 you should return false", + "status": "passed" + }, + { + "title": "If num1 is EQUAL to num2 you should return -1", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/02-CompareStrings.json b/.learn/reports/02-CompareStrings.json new file mode 100644 index 0000000..d4c3945 --- /dev/null +++ b/.learn/reports/02-CompareStrings.json @@ -0,0 +1,25 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 3, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "Function compareStrings should exist", + "status": "passed" + }, + { + "title": "If the strings have the same length it should be true", + "status": "passed" + }, + { + "title": "If the strings have the different lengths it should be false", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/03-DivisibleBy5.json b/.learn/reports/03-DivisibleBy5.json new file mode 100644 index 0000000..604fa13 --- /dev/null +++ b/.learn/reports/03-DivisibleBy5.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "Function divisibleBy5 should exist", + "status": "passed" + }, + { + "title": "Number should be divisible by 5", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/04-VowelCount.json b/.learn/reports/04-VowelCount.json new file mode 100644 index 0000000..9f1100d --- /dev/null +++ b/.learn/reports/04-VowelCount.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "findVowels function must exist.", + "status": "passed" + }, + { + "title": "You must have the correct number of vowels", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/02-AreaOfTriangle/app.js b/.learn/resets/01-AreaOfTriangle/app.js similarity index 100% rename from 02-AreaOfTriangle/app.js rename to .learn/resets/01-AreaOfTriangle/app.js diff --git a/03-CompareStrings/app.js b/.learn/resets/02-CompareStrings/app.js similarity index 100% rename from 03-CompareStrings/app.js rename to .learn/resets/02-CompareStrings/app.js diff --git a/04-DivisibleBy5/app.js b/.learn/resets/03-DivisibleBy5/app.js similarity index 100% rename from 04-DivisibleBy5/app.js rename to .learn/resets/03-DivisibleBy5/app.js diff --git a/.learn/resets/04-VowelCount/app.js b/.learn/resets/04-VowelCount/app.js new file mode 100644 index 0000000..7a19ec1 --- /dev/null +++ b/.learn/resets/04-VowelCount/app.js @@ -0,0 +1,8 @@ +// your code here +function findVowels(word){ + const matched = word.match(/[aeiou]/gi); + console.log(matched ? matched.length : 0); + return matched ? matched.length : 0; +} + +findVowels("carolas") \ No newline at end of file diff --git a/.learn/vscode_queue.json b/.learn/vscode_queue.json index 58509e3..9ab51d6 100644 --- a/.learn/vscode_queue.json +++ b/.learn/vscode_queue.json @@ -1 +1 @@ -[{"name":"initializing","time":175129340.75},{"name":"reset","time":175129359.416},{"name":"configuration_loaded","time":175133222},{"name":"start_exercise","time":174443594.333,"data":"02-AreaOfTriangle"},{"name":"open_files","time":174448481.541,"data":["02-AreaOfTriangle/app.js"]},{"name":"open_files","time":174692660.958,"data":["02-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":175150820.125,"data":"03-CompareStrings"},{"name":"open_files","time":175157106.375,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174390734.666,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175133106.75,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175085562.583,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174504868.833,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174565310.916,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175069917.166,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174601782.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175152446.708,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174998122.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174399577.666,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175336814.708,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174588032.708,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174916562.625,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174454711.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174728497.625,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175131962.333,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174772987,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175329922.166,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174860770.75,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174867352.916,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174937181.333,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174485081.208,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175056026.666,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175095521,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174928569.958,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174456907.333,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174466553.708,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175328004.666,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175311400.458,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175016122.416,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174838107.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175078291.416,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174509831.458,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174780835.375,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175351647.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175403420.083,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174962067.458,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175202247.916,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174600329.791,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175429568.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175257939.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175242050.291,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175243982.875,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175563987.375,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175102941.208,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175319291.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174645130.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175456348.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174730602.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174902596.583,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175511166.541,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175235145.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174979396.416,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174902875.75,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175403786.25,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175380266.125,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175001536.625,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":174908615.041,"data":["03-CompareStrings/app.js"]},{"name":"open_files","time":175169835.958,"data":["03-CompareStrings/app.js"]}] \ No newline at end of file +[{"name":"initializing","time":158262652.875},{"name":"reset","time":158262673.5},{"name":"configuration_loaded","time":158266763.458},{"name":"start_exercise","time":157799868.416,"data":"01-AreaOfTriangle"},{"name":"open_files","time":157833631.416,"data":["01-AreaOfTriangle/app.js"]},{"name":"open_files","time":158120033.583,"data":["01-AreaOfTriangle/app.js"]},{"name":"open_files","time":158457778.041,"data":["01-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":158457658.958,"data":"02-CompareStrings"},{"name":"open_files","time":158462296,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":157571677.75,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":158025960.875,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":157862341.625,"data":"03-DivisibleBy5"},{"name":"open_files","time":157868347.25,"data":["03-DivisibleBy5/app.js"]},{"name":"open_files","time":158054669.75,"data":["03-DivisibleBy5/app.js"]},{"name":"open_files","time":158457209.583,"data":["03-DivisibleBy5/app.js"]},{"name":"start_exercise","time":157840373.583,"data":"04-VowelCount"},{"name":"open_files","time":157844680.625,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":158376354.083,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":158815933.458,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163135410.416,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163324334.166,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163264203.166,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162989777.208,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162703983.625,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162524171.916,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163252458.125,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162475878.875,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162789428.833,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163176607.291,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162512713.5,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162505540.916,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163162659.875,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163310188.791,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163027328.208,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163218804.958,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163382457.166,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162511435.666,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163056148.958,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163011568.916,"data":["04-VowelCount/app.js"]}] \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..c4165dc --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.autoSave": "afterDelay", + "files.autoSaveDelay": 700, + "editor.minimap.enabled": false +} diff --git a/02-AreaOfTriangle/README.es.md b/01-AreaOfTriangle/README.es.md similarity index 82% rename from 02-AreaOfTriangle/README.es.md rename to 01-AreaOfTriangle/README.es.md index 3b6a54b..1679e6f 100644 --- a/02-AreaOfTriangle/README.es.md +++ b/01-AreaOfTriangle/README.es.md @@ -1,7 +1,7 @@ -# `02` 02-AreaOfTriangle +# `01` 01-AreaOfTriangle Haz que la funcion checkNums(num1,num2) tome lo dos parametros siendo pasados. -# Instructions 🗒 +# Instrucciones 🗒 1. Retorna `true` si `num2` es mayor que `num1`, de lo contrario retorna `false`. 2. Si los paremetros son iguales retorna `-1`. \ No newline at end of file diff --git a/02-AreaOfTriangle/README.md b/01-AreaOfTriangle/README.md similarity index 90% rename from 02-AreaOfTriangle/README.md rename to 01-AreaOfTriangle/README.md index da61a06..339304b 100644 --- a/02-AreaOfTriangle/README.md +++ b/01-AreaOfTriangle/README.md @@ -1,4 +1,4 @@ -# `02` 02-AreaOfTriangle +# `01` 01-AreaOfTriangle Have the function checkNums(num1,num2) take both parameters being passed. diff --git a/01-AreaOfTriangle/app.js b/01-AreaOfTriangle/app.js new file mode 100644 index 0000000..4b97e77 --- /dev/null +++ b/01-AreaOfTriangle/app.js @@ -0,0 +1,4 @@ +// your code here +function checkNums(num1, num2){ + return num2 > num1 ? true : num1 > num2 ? false : -1; +} \ No newline at end of file diff --git a/02-AreaOfTriangle/test.js b/01-AreaOfTriangle/test.js similarity index 100% rename from 02-AreaOfTriangle/test.js rename to 01-AreaOfTriangle/test.js diff --git a/01-hello-world/README.es.md b/01-hello-world/README.es.md deleted file mode 100644 index fe34a8c..0000000 --- a/01-hello-world/README.es.md +++ /dev/null @@ -1,26 +0,0 @@ -# `01` Primer Ejercicio - -Hemos creado este primer ejercicio como ejemplo. Lo puedes ubicar en la carpeta `./01-hello-world`. - -1. Cada ejercicio debe estar ubicado en carpetas separadas y debe tener un archivo README.md con las instrucciones del ejercicio escrito en markdown. -2. Puedes tener un archivo README el cual será como una página de un libro, sin archivos de código. -3. También puedes agregar un archivo `README.[lenguaje].md` para traducciones, por ejemplo `README.es.md` para español. - -## Inserta videos - -Si quieres incluir algún video introductorio para cada ejercicio, agrega la propiedad `intro` en el inicio del README.md para ese ejercicio en particular: - -```markdown ---- -intro: "https://www.youtube.com/watch?v=YkgkThdzX-8" ---- -``` - -Tambien puedes agregar un video explicando la solución para cada ejercicio agregando la propiedad `tutorial` al inicio del markdown del README.md correspondiente: - -```markdown ---- -intro: "https://www.youtube.com/watch?v=YkgkThdzX-8" -tutorial: "https://www.youtube.com/watch?v=YkgkThdzX-8" ---- -``` diff --git a/01-hello-world/README.md b/01-hello-world/README.md deleted file mode 100644 index 0a2afc4..0000000 --- a/01-hello-world/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# `01` 01-Hello-World - -Write a function `helloWorld` that returns `"Hello World"` \ No newline at end of file diff --git a/01-hello-world/app.js b/01-hello-world/app.js deleted file mode 100644 index 7bf0a14..0000000 --- a/01-hello-world/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// your code here -function helloWorld() { - return "Hello World"; -} \ No newline at end of file diff --git a/01-hello-world/test.js b/01-hello-world/test.js deleted file mode 100644 index b7fa95d..0000000 --- a/01-hello-world/test.js +++ /dev/null @@ -1,7 +0,0 @@ -const rewire = require("rewire") -const app = rewire('./app.js') - -test('There should be a function called helloWorld', () => { - const total = app.__get__("helloWorld"); - expect(total).toBeTruthy(); -}) \ No newline at end of file diff --git a/03-CompareStrings/README.es.md b/02-CompareStrings/README.es.md similarity index 83% rename from 03-CompareStrings/README.es.md rename to 02-CompareStrings/README.es.md index 1f19fd9..0b4be97 100644 --- a/03-CompareStrings/README.es.md +++ b/02-CompareStrings/README.es.md @@ -1,6 +1,6 @@ -# `03` 03-ComapreStrings +# `02` 02-ComapreStrings Crea una funcion `compareStrings` que toma dos strings como argumentos. -# Instructions 🗒 +# Instrucciones 🗒 1. Retorna `true` o `false` dependiendo en que el total de caracteres en la primera string sea igual en tamanio al numero de caracters en la segunda string. \ No newline at end of file diff --git a/03-CompareStrings/README.md b/02-CompareStrings/README.md similarity index 91% rename from 03-CompareStrings/README.md rename to 02-CompareStrings/README.md index 52337be..83c1dbe 100644 --- a/03-CompareStrings/README.md +++ b/02-CompareStrings/README.md @@ -1,4 +1,4 @@ -# `03` 03-ComapreStrings +# `02` 02-ComapreStrings Create a function `compareStrings` that takes two strings as arguments. diff --git a/02-CompareStrings/app.js b/02-CompareStrings/app.js new file mode 100644 index 0000000..fc789ff --- /dev/null +++ b/02-CompareStrings/app.js @@ -0,0 +1,8 @@ +// your code here +function compareStrings(string1, string2) { + if (string1.length === string2.length) { + return true + } else { + return false + } +} \ No newline at end of file diff --git a/03-CompareStrings/test.js b/02-CompareStrings/test.js similarity index 100% rename from 03-CompareStrings/test.js rename to 02-CompareStrings/test.js diff --git a/03-DivisibleBy5/README.es.md b/03-DivisibleBy5/README.es.md new file mode 100644 index 0000000..a026f60 --- /dev/null +++ b/03-DivisibleBy5/README.es.md @@ -0,0 +1,4 @@ +# `03` 03-DivisibleBy5 + +# Instrucciones 🗒 +1. Crea una función que retorne `true` si un integral es dividido por `5`, y `false` si no lo es. \ No newline at end of file diff --git a/04-DivisibleBy5/README.md b/03-DivisibleBy5/README.md similarity index 83% rename from 04-DivisibleBy5/README.md rename to 03-DivisibleBy5/README.md index 8e0b6c6..eb5bce1 100644 --- a/04-DivisibleBy5/README.md +++ b/03-DivisibleBy5/README.md @@ -1,4 +1,4 @@ -# `04` 04-DivisibleBy5 +# `03` 03-DivisibleBy5 # Instructions 🗒 1. Create a function that returns `true` if an integer is divisible by `5`, and `false` otherwise. \ No newline at end of file diff --git a/03-DivisibleBy5/app.js b/03-DivisibleBy5/app.js new file mode 100644 index 0000000..d3029b7 --- /dev/null +++ b/03-DivisibleBy5/app.js @@ -0,0 +1,4 @@ +// your code here + function divisibleBy5(int) { + return int % 5 === 0 ? true : false; + } \ No newline at end of file diff --git a/04-DivisibleBy5/test.js b/03-DivisibleBy5/test.js similarity index 100% rename from 04-DivisibleBy5/test.js rename to 03-DivisibleBy5/test.js diff --git a/04-DivisibleBy5/README.es.md b/04-DivisibleBy5/README.es.md deleted file mode 100644 index e69de29..0000000 diff --git a/04-VowelCount/README.es.md b/04-VowelCount/README.es.md new file mode 100644 index 0000000..588a83d --- /dev/null +++ b/04-VowelCount/README.es.md @@ -0,0 +1,4 @@ +# `04` 04-VowelCount + +# Instructions 🗒 +1. Crea una funcion que tome un `string` y retorne la cantidad de vocales que esta contiene. \ No newline at end of file diff --git a/04-VowelCount/README.md b/04-VowelCount/README.md new file mode 100644 index 0000000..31bf69b --- /dev/null +++ b/04-VowelCount/README.md @@ -0,0 +1,4 @@ +# `04` 04-VowelCount + +# Instrucciones 🗒 +1. Create a function that takes a `string` and returns the number of vowels contained within it. \ No newline at end of file diff --git a/04-VowelCount/app.js b/04-VowelCount/app.js new file mode 100644 index 0000000..5702e41 --- /dev/null +++ b/04-VowelCount/app.js @@ -0,0 +1,5 @@ +// your code here +function findVowels(word){ + const matched = word.match(/[aeiou]/gi); + return matched ? matched.length : 0; +} \ No newline at end of file diff --git a/04-VowelCount/test.js b/04-VowelCount/test.js new file mode 100644 index 0000000..7618d7f --- /dev/null +++ b/04-VowelCount/test.js @@ -0,0 +1,15 @@ +const rewire = require("rewire") +const app = rewire('./app.js') + + +test('findVowels function must exist.', ()=>{ + const findVowels = app.__get__('findVowels') + expect(findVowels).toBeTruthy(); +}) + +test('You must have the correct number of vowels', ()=>{ + const findVowels = app.__get__("findVowels"); + + expect(findVowels("carola")).toBe(3) + expect(findVowels("youtube")).toBe(4) +}) \ No newline at end of file From b62eab66977931e6e54b70b50852559f80e3d4ee Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 19:46:47 -0400 Subject: [PATCH 05/28] Instructions for all exercises added and fixed --- {01-AreaOfTriangle => 01-CheckNums}/README.es.md | 4 ++-- {01-AreaOfTriangle => 01-CheckNums}/README.md | 4 ++-- {01-AreaOfTriangle => 01-CheckNums}/app.js | 0 {01-AreaOfTriangle => 01-CheckNums}/test.js | 0 02-CompareStrings/README.es.md | 4 ++-- 02-CompareStrings/README.md | 4 ++-- 03-DivisibleBy5/README.es.md | 4 ++-- 03-DivisibleBy5/README.md | 4 ++-- 04-VowelCount/README.es.md | 4 ++-- 04-VowelCount/README.md | 4 ++-- 05-AreaOfTriangle/README.es.md | 4 ++++ 05-AreaOfTriangle/README.md | 4 ++++ 05-AreaOfTriangle/app.js | 1 + 05-AreaOfTriangle/test.js | 15 +++++++++++++++ 06-LongestWord/README.es.md | 4 ++++ 06-LongestWord/README.md | 4 ++++ 06-LongestWord/app.js | 1 + 06-LongestWord/test.js | 15 +++++++++++++++ 07-MissingAngle/README.es.md | 6 ++++++ 07-MissingAngle/README.md | 6 ++++++ 07-MissingAngle/app.js | 1 + 07-MissingAngle/test.js | 15 +++++++++++++++ 08-NumberLimit/README.es.md | 6 ++++++ 08-NumberLimit/README.md | 6 ++++++ 08-NumberLimit/app.js | 1 + 08-NumberLimit/test.js | 15 +++++++++++++++ 09-FormatPhoneNumber/README.es.md | 8 ++++++++ 09-FormatPhoneNumber/README.md | 8 ++++++++ 09-FormatPhoneNumber/app.js | 1 + 09-FormatPhoneNumber/test.js | 15 +++++++++++++++ 10-ShareCake/README.es.md | 6 ++++++ 10-ShareCake/README.md | 6 ++++++ 10-ShareCake/app.js | 1 + 10-ShareCake/test.js | 15 +++++++++++++++ 34 files changed, 180 insertions(+), 16 deletions(-) rename {01-AreaOfTriangle => 01-CheckNums}/README.es.md (82%) rename {01-AreaOfTriangle => 01-CheckNums}/README.md (83%) rename {01-AreaOfTriangle => 01-CheckNums}/app.js (100%) rename {01-AreaOfTriangle => 01-CheckNums}/test.js (100%) create mode 100644 05-AreaOfTriangle/README.es.md create mode 100644 05-AreaOfTriangle/README.md create mode 100644 05-AreaOfTriangle/app.js create mode 100644 05-AreaOfTriangle/test.js create mode 100644 06-LongestWord/README.es.md create mode 100644 06-LongestWord/README.md create mode 100644 06-LongestWord/app.js create mode 100644 06-LongestWord/test.js create mode 100644 07-MissingAngle/README.es.md create mode 100644 07-MissingAngle/README.md create mode 100644 07-MissingAngle/app.js create mode 100644 07-MissingAngle/test.js create mode 100644 08-NumberLimit/README.es.md create mode 100644 08-NumberLimit/README.md create mode 100644 08-NumberLimit/app.js create mode 100644 08-NumberLimit/test.js create mode 100644 09-FormatPhoneNumber/README.es.md create mode 100644 09-FormatPhoneNumber/README.md create mode 100644 09-FormatPhoneNumber/app.js create mode 100644 09-FormatPhoneNumber/test.js create mode 100644 10-ShareCake/README.es.md create mode 100644 10-ShareCake/README.md create mode 100644 10-ShareCake/app.js create mode 100644 10-ShareCake/test.js diff --git a/01-AreaOfTriangle/README.es.md b/01-CheckNums/README.es.md similarity index 82% rename from 01-AreaOfTriangle/README.es.md rename to 01-CheckNums/README.es.md index 1679e6f..75419af 100644 --- a/01-AreaOfTriangle/README.es.md +++ b/01-CheckNums/README.es.md @@ -1,7 +1,7 @@ -# `01` 01-AreaOfTriangle +# `01` Check Nums Haz que la funcion checkNums(num1,num2) tome lo dos parametros siendo pasados. -# Instrucciones 🗒 +## Instrucciones 🗒 1. Retorna `true` si `num2` es mayor que `num1`, de lo contrario retorna `false`. 2. Si los paremetros son iguales retorna `-1`. \ No newline at end of file diff --git a/01-AreaOfTriangle/README.md b/01-CheckNums/README.md similarity index 83% rename from 01-AreaOfTriangle/README.md rename to 01-CheckNums/README.md index 339304b..3bb710d 100644 --- a/01-AreaOfTriangle/README.md +++ b/01-CheckNums/README.md @@ -1,7 +1,7 @@ -# `01` 01-AreaOfTriangle +# `01` Check Nums Have the function checkNums(num1,num2) take both parameters being passed. -# Instructions 🗒 +## Instructions 🗒 1. Return true if `num2` is greater than `num1`, otherwise return `false`. 2. If the parameter values are equal to each other then return `-1`. \ No newline at end of file diff --git a/01-AreaOfTriangle/app.js b/01-CheckNums/app.js similarity index 100% rename from 01-AreaOfTriangle/app.js rename to 01-CheckNums/app.js diff --git a/01-AreaOfTriangle/test.js b/01-CheckNums/test.js similarity index 100% rename from 01-AreaOfTriangle/test.js rename to 01-CheckNums/test.js diff --git a/02-CompareStrings/README.es.md b/02-CompareStrings/README.es.md index 0b4be97..d074289 100644 --- a/02-CompareStrings/README.es.md +++ b/02-CompareStrings/README.es.md @@ -1,6 +1,6 @@ -# `02` 02-ComapreStrings +# `02` Comapre Strings Crea una funcion `compareStrings` que toma dos strings como argumentos. -# Instrucciones 🗒 +## Instrucciones 🗒 1. Retorna `true` o `false` dependiendo en que el total de caracteres en la primera string sea igual en tamanio al numero de caracters en la segunda string. \ No newline at end of file diff --git a/02-CompareStrings/README.md b/02-CompareStrings/README.md index 83c1dbe..6f086ec 100644 --- a/02-CompareStrings/README.md +++ b/02-CompareStrings/README.md @@ -1,6 +1,6 @@ -# `02` 02-ComapreStrings +# `02` Comapre Strings Create a function `compareStrings` that takes two strings as arguments. -# Instructions 🗒 +## Instructions 🗒 1. Return either `true` or `false` depending on whether the total number of characters in the first string is equal to the total number of characters in the second string. \ No newline at end of file diff --git a/03-DivisibleBy5/README.es.md b/03-DivisibleBy5/README.es.md index a026f60..57f54a8 100644 --- a/03-DivisibleBy5/README.es.md +++ b/03-DivisibleBy5/README.es.md @@ -1,4 +1,4 @@ -# `03` 03-DivisibleBy5 +# `03` Divisible By 5 -# Instrucciones 🗒 +## Instrucciones 🗒 1. Crea una función que retorne `true` si un integral es dividido por `5`, y `false` si no lo es. \ No newline at end of file diff --git a/03-DivisibleBy5/README.md b/03-DivisibleBy5/README.md index eb5bce1..9e56d6d 100644 --- a/03-DivisibleBy5/README.md +++ b/03-DivisibleBy5/README.md @@ -1,4 +1,4 @@ -# `03` 03-DivisibleBy5 +# `03` Divisible By 5 -# Instructions 🗒 +## Instructions 🗒 1. Create a function that returns `true` if an integer is divisible by `5`, and `false` otherwise. \ No newline at end of file diff --git a/04-VowelCount/README.es.md b/04-VowelCount/README.es.md index 588a83d..d97b2a4 100644 --- a/04-VowelCount/README.es.md +++ b/04-VowelCount/README.es.md @@ -1,4 +1,4 @@ -# `04` 04-VowelCount +# `04` Vowel Counter -# Instructions 🗒 +## Instructions 🗒 1. Crea una funcion que tome un `string` y retorne la cantidad de vocales que esta contiene. \ No newline at end of file diff --git a/04-VowelCount/README.md b/04-VowelCount/README.md index 31bf69b..2afde21 100644 --- a/04-VowelCount/README.md +++ b/04-VowelCount/README.md @@ -1,4 +1,4 @@ -# `04` 04-VowelCount +# `04` Vowel Counter -# Instrucciones 🗒 +## Instructions 🗒 1. Create a function that takes a `string` and returns the number of vowels contained within it. \ No newline at end of file diff --git a/05-AreaOfTriangle/README.es.md b/05-AreaOfTriangle/README.es.md new file mode 100644 index 0000000..8634444 --- /dev/null +++ b/05-AreaOfTriangle/README.es.md @@ -0,0 +1,4 @@ +# `05` Area Of The Triangle + +## Instrucciones 🗒 +1. Escribe una funcion `AreaOfTriangle` que toma la `base` y la `altura` de un triangulo y retorna su `area`. \ No newline at end of file diff --git a/05-AreaOfTriangle/README.md b/05-AreaOfTriangle/README.md new file mode 100644 index 0000000..d6e307e --- /dev/null +++ b/05-AreaOfTriangle/README.md @@ -0,0 +1,4 @@ +# `05` Area Of The Triangle + +## Instructions 🗒 +1. Write a function `AreaOfTriangle` that takes the `base` and `height` of a triangle and print its `area`. \ No newline at end of file diff --git a/05-AreaOfTriangle/app.js b/05-AreaOfTriangle/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/05-AreaOfTriangle/app.js @@ -0,0 +1 @@ +// your code here diff --git a/05-AreaOfTriangle/test.js b/05-AreaOfTriangle/test.js new file mode 100644 index 0000000..7618d7f --- /dev/null +++ b/05-AreaOfTriangle/test.js @@ -0,0 +1,15 @@ +const rewire = require("rewire") +const app = rewire('./app.js') + + +test('findVowels function must exist.', ()=>{ + const findVowels = app.__get__('findVowels') + expect(findVowels).toBeTruthy(); +}) + +test('You must have the correct number of vowels', ()=>{ + const findVowels = app.__get__("findVowels"); + + expect(findVowels("carola")).toBe(3) + expect(findVowels("youtube")).toBe(4) +}) \ No newline at end of file diff --git a/06-LongestWord/README.es.md b/06-LongestWord/README.es.md new file mode 100644 index 0000000..b03ec44 --- /dev/null +++ b/06-LongestWord/README.es.md @@ -0,0 +1,4 @@ +# `06` Longest Word + +## Instrucciones 🗒 +1. Escribe una funcion `longestWord` que toma `(sen)` como un parametro y retorna la palabra más larga en una frase. \ No newline at end of file diff --git a/06-LongestWord/README.md b/06-LongestWord/README.md new file mode 100644 index 0000000..3c18562 --- /dev/null +++ b/06-LongestWord/README.md @@ -0,0 +1,4 @@ +# `06` Longest Word + +## Instructions 🗒 +1. Write a function `longestWord` that takes in `(sen)` as a parameter and returns the longest word in a sentence. \ No newline at end of file diff --git a/06-LongestWord/app.js b/06-LongestWord/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/06-LongestWord/app.js @@ -0,0 +1 @@ +// your code here diff --git a/06-LongestWord/test.js b/06-LongestWord/test.js new file mode 100644 index 0000000..7618d7f --- /dev/null +++ b/06-LongestWord/test.js @@ -0,0 +1,15 @@ +const rewire = require("rewire") +const app = rewire('./app.js') + + +test('findVowels function must exist.', ()=>{ + const findVowels = app.__get__('findVowels') + expect(findVowels).toBeTruthy(); +}) + +test('You must have the correct number of vowels', ()=>{ + const findVowels = app.__get__("findVowels"); + + expect(findVowels("carola")).toBe(3) + expect(findVowels("youtube")).toBe(4) +}) \ No newline at end of file diff --git a/07-MissingAngle/README.es.md b/07-MissingAngle/README.es.md new file mode 100644 index 0000000..db29a8b --- /dev/null +++ b/07-MissingAngle/README.es.md @@ -0,0 +1,6 @@ +# `07` Missing Angle + +## Instrucciones 🗒 +1. Crea una funcion `missingAngle` que clasifica el angulo faltante como "agudo", "recto", or "obtuso" basado en los grados. +2. Provee dos numeros argumentos. +3. Calcula el angulo faltante sumando los dos numeros y restandolos de 180 grados. \ No newline at end of file diff --git a/07-MissingAngle/README.md b/07-MissingAngle/README.md new file mode 100644 index 0000000..fb54f8c --- /dev/null +++ b/07-MissingAngle/README.md @@ -0,0 +1,6 @@ +# `07` Missing Angle + +## Instructions 🗒 +1. Create a function `missingAngle` that classifies the missing angle as either "acute", "right", or "obtuse" based on its degrees. +2. Provide two numbers as arguments. +3. Calculate the missing degree by adding the two numbers and subtracting that from 180. \ No newline at end of file diff --git a/07-MissingAngle/app.js b/07-MissingAngle/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/07-MissingAngle/app.js @@ -0,0 +1 @@ +// your code here diff --git a/07-MissingAngle/test.js b/07-MissingAngle/test.js new file mode 100644 index 0000000..7618d7f --- /dev/null +++ b/07-MissingAngle/test.js @@ -0,0 +1,15 @@ +const rewire = require("rewire") +const app = rewire('./app.js') + + +test('findVowels function must exist.', ()=>{ + const findVowels = app.__get__('findVowels') + expect(findVowels).toBeTruthy(); +}) + +test('You must have the correct number of vowels', ()=>{ + const findVowels = app.__get__("findVowels"); + + expect(findVowels("carola")).toBe(3) + expect(findVowels("youtube")).toBe(4) +}) \ No newline at end of file diff --git a/08-NumberLimit/README.es.md b/08-NumberLimit/README.es.md new file mode 100644 index 0000000..aed666d --- /dev/null +++ b/08-NumberLimit/README.es.md @@ -0,0 +1,6 @@ +# `08` Number Limit +## Instrucciones 🗒 +1. Escriba una función `numLimit` que tome tres argumentos numéricos (un número como entrada y los otros dos números que representan los puntos más bajo y más alto del rango). +2. Si el número cae dentro del rango, `retorna` el número. +3. Si el número es menor que el límite inferior del rango, `retorna` el número del límite inferior. +4. Si el número es mayor que el límite superior del rango, `retorna` el número del límite más alto. \ No newline at end of file diff --git a/08-NumberLimit/README.md b/08-NumberLimit/README.md new file mode 100644 index 0000000..9872c03 --- /dev/null +++ b/08-NumberLimit/README.md @@ -0,0 +1,6 @@ +# `08` Number Limit +## Instructions 🗒 +1. Write a function `numLimit` which takes three number arguments (one number as an input and the other two numbers representing the lowest and highest points of the range). +2. If the number falls within the range, `return` the number. +3. If the number is less than the lower limit of the range, `return` the lowest limit number. +4. Ff the number is greater than the upper limit of the range, `return` the highest limit number. \ No newline at end of file diff --git a/08-NumberLimit/app.js b/08-NumberLimit/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/08-NumberLimit/app.js @@ -0,0 +1 @@ +// your code here diff --git a/08-NumberLimit/test.js b/08-NumberLimit/test.js new file mode 100644 index 0000000..7618d7f --- /dev/null +++ b/08-NumberLimit/test.js @@ -0,0 +1,15 @@ +const rewire = require("rewire") +const app = rewire('./app.js') + + +test('findVowels function must exist.', ()=>{ + const findVowels = app.__get__('findVowels') + expect(findVowels).toBeTruthy(); +}) + +test('You must have the correct number of vowels', ()=>{ + const findVowels = app.__get__("findVowels"); + + expect(findVowels("carola")).toBe(3) + expect(findVowels("youtube")).toBe(4) +}) \ No newline at end of file diff --git a/09-FormatPhoneNumber/README.es.md b/09-FormatPhoneNumber/README.es.md new file mode 100644 index 0000000..46dbeec --- /dev/null +++ b/09-FormatPhoneNumber/README.es.md @@ -0,0 +1,8 @@ +# `09` Format Phone Number + +## Instrucciones 🗒 +1. Cree una función `formatPhoneNumber` que tome un array de `10` números entre `0` y `9` y `retorne` una cadena de números formateados como un número de teléfono. +2. La llamada de la función debería parecerse a algo como esto: +``` JavaScript +formatPhoneNumber(4, 4, 1, 2, 3, 4, 5, 6, 7, 8) +``` \ No newline at end of file diff --git a/09-FormatPhoneNumber/README.md b/09-FormatPhoneNumber/README.md new file mode 100644 index 0000000..eed3ae0 --- /dev/null +++ b/09-FormatPhoneNumber/README.md @@ -0,0 +1,8 @@ +# `09` Format Phone Number + +## Instructions 🗒 +1. Create a function `formatPhoneNumber` that takes an array of `10` numbers between `0` and `9`and `returns` a string of numbers formatted as a phone number. +2. The function call should resemble something like this: +```JavaScript +formatPhoneNumber(4, 4, 1, 2, 3, 4, 5, 6, 7, 8) +``` \ No newline at end of file diff --git a/09-FormatPhoneNumber/app.js b/09-FormatPhoneNumber/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/09-FormatPhoneNumber/app.js @@ -0,0 +1 @@ +// your code here diff --git a/09-FormatPhoneNumber/test.js b/09-FormatPhoneNumber/test.js new file mode 100644 index 0000000..7618d7f --- /dev/null +++ b/09-FormatPhoneNumber/test.js @@ -0,0 +1,15 @@ +const rewire = require("rewire") +const app = rewire('./app.js') + + +test('findVowels function must exist.', ()=>{ + const findVowels = app.__get__('findVowels') + expect(findVowels).toBeTruthy(); +}) + +test('You must have the correct number of vowels', ()=>{ + const findVowels = app.__get__("findVowels"); + + expect(findVowels("carola")).toBe(3) + expect(findVowels("youtube")).toBe(4) +}) \ No newline at end of file diff --git a/10-ShareCake/README.es.md b/10-ShareCake/README.es.md new file mode 100644 index 0000000..dcad753 --- /dev/null +++ b/10-ShareCake/README.es.md @@ -0,0 +1,6 @@ +# `10` Share the Cake + +## Instrucciones 🗒 +1. Cree una función `sliceOfCake` que determine si es posible o no compartir el pastel de manera justa dados estos tres parámetros: `Total de rebanadas`, `Destinatarios`, `Rebanadas` cada uno. +2. Está bien no usar todo el pastel. +3. Retorne `true` si el pastel se puede compartir por igual; de lo contrario, retorne `false`. \ No newline at end of file diff --git a/10-ShareCake/README.md b/10-ShareCake/README.md new file mode 100644 index 0000000..9c05342 --- /dev/null +++ b/10-ShareCake/README.md @@ -0,0 +1,6 @@ +# `10` Share the Cake + +## Instructions 🗒 +1. Create a function `sliceOfCake`that determines whether or not it's possible to share the cake fairly given these three parameters: `Total slices`, `Recipients`, `Slices` each. +2. It's fine not to use the entire cake. +3. Print `true` if the cake can be shared equally, otherwise print `false`. \ No newline at end of file diff --git a/10-ShareCake/app.js b/10-ShareCake/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/10-ShareCake/app.js @@ -0,0 +1 @@ +// your code here diff --git a/10-ShareCake/test.js b/10-ShareCake/test.js new file mode 100644 index 0000000..7618d7f --- /dev/null +++ b/10-ShareCake/test.js @@ -0,0 +1,15 @@ +const rewire = require("rewire") +const app = rewire('./app.js') + + +test('findVowels function must exist.', ()=>{ + const findVowels = app.__get__('findVowels') + expect(findVowels).toBeTruthy(); +}) + +test('You must have the correct number of vowels', ()=>{ + const findVowels = app.__get__("findVowels"); + + expect(findVowels("carola")).toBe(3) + expect(findVowels("youtube")).toBe(4) +}) \ No newline at end of file From a058a961c7b47dc243d1d122d314f244e15e6c56 Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 19:51:38 -0400 Subject: [PATCH 06/28] added test for exercise 05 --- 05-AreaOfTriangle/test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/05-AreaOfTriangle/test.js b/05-AreaOfTriangle/test.js index 7618d7f..4db2713 100644 --- a/05-AreaOfTriangle/test.js +++ b/05-AreaOfTriangle/test.js @@ -2,14 +2,14 @@ const rewire = require("rewire") const app = rewire('./app.js') -test('findVowels function must exist.', ()=>{ - const findVowels = app.__get__('findVowels') - expect(findVowels).toBeTruthy(); +test('AreaOfTriangle function must exist.', ()=>{ + const AreaOfTriangle = app.__get__('AreaOfTriangle') + expect(AreaOfTriangle).toBeTruthy(); }) -test('You must have the correct number of vowels', ()=>{ - const findVowels = app.__get__("findVowels"); +test('The base for the triangle is correct', ()=>{ + const AreaOfTriangle = app.__get__("AreaOfTriangle"); - expect(findVowels("carola")).toBe(3) - expect(findVowels("youtube")).toBe(4) + expect(AreaOfTriangle(2,5)).toBe(5) + expect(AreaOfTriangle(7,14)).toBe(49) }) \ No newline at end of file From 765580385f65a4738e18b1f6c3244bb1dfa60748 Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 20:59:25 -0400 Subject: [PATCH 07/28] test for exercise 06 done --- 06-LongestWord/test.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/06-LongestWord/test.js b/06-LongestWord/test.js index 7618d7f..9d53d80 100644 --- a/06-LongestWord/test.js +++ b/06-LongestWord/test.js @@ -2,14 +2,14 @@ const rewire = require("rewire") const app = rewire('./app.js') -test('findVowels function must exist.', ()=>{ - const findVowels = app.__get__('findVowels') - expect(findVowels).toBeTruthy(); +test('longestWord function must exist.', ()=>{ + const longestWord = app.__get__('longestWord') + expect(longestWord).toBeTruthy(); }) -test('You must have the correct number of vowels', ()=>{ - const findVowels = app.__get__("findVowels"); +test('You should return the longest word', ()=>{ + const longestWord = app.__get__("longestWord"); - expect(findVowels("carola")).toBe(3) - expect(findVowels("youtube")).toBe(4) + expect(longestWord("Well, which is the longest word?")).toBe("longest"); + expect(longestWord("Hello my name is Nicola de Fuentevideo")).toBe("Fuentevideo"); }) \ No newline at end of file From e3e632762158bd11c95374fba076714668624a89 Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 21:12:01 -0400 Subject: [PATCH 08/28] Finished test for 07 --- 07-MissingAngle/README.md | 2 +- 07-MissingAngle/test.js | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/07-MissingAngle/README.md b/07-MissingAngle/README.md index fb54f8c..de91f27 100644 --- a/07-MissingAngle/README.md +++ b/07-MissingAngle/README.md @@ -1,6 +1,6 @@ # `07` Missing Angle ## Instructions 🗒 -1. Create a function `missingAngle` that classifies the missing angle as either "acute", "right", or "obtuse" based on its degrees. +1. Create a function `missingAngle` that classifies the missing angle as either "Acute", "Right", or "Obtuse" based on its degrees. 2. Provide two numbers as arguments. 3. Calculate the missing degree by adding the two numbers and subtracting that from 180. \ No newline at end of file diff --git a/07-MissingAngle/test.js b/07-MissingAngle/test.js index 7618d7f..8f7d825 100644 --- a/07-MissingAngle/test.js +++ b/07-MissingAngle/test.js @@ -2,14 +2,16 @@ const rewire = require("rewire") const app = rewire('./app.js') -test('findVowels function must exist.', ()=>{ - const findVowels = app.__get__('findVowels') - expect(findVowels).toBeTruthy(); +test('missingAngle function must exist.', ()=>{ + const missingAngle = app.__get__('missingAngle') + expect(missingAngle).toBeTruthy(); }) -test('You must have the correct number of vowels', ()=>{ - const findVowels = app.__get__("findVowels"); +test('The missing angle is correctly classified.', ()=>{ + const missingAngle = app.__get__("missingAngle"); - expect(findVowels("carola")).toBe(3) - expect(findVowels("youtube")).toBe(4) + expect(missingAngle(25, 30)).toBe("Obtuse") + expect(missingAngle(17, 71)).toBe("Obtuse") + expect(missingAngle(26, 90)).toBe("Acute") + expect(missingAngle(54, 36)).toBe("Right") }) \ No newline at end of file From af3ce7c3163c163dd661627bf186cfac60fbc145 Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 21:18:34 -0400 Subject: [PATCH 09/28] Test for exercise 08 done --- 08-NumberLimit/test.js | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/08-NumberLimit/test.js b/08-NumberLimit/test.js index 7618d7f..d85a310 100644 --- a/08-NumberLimit/test.js +++ b/08-NumberLimit/test.js @@ -1,15 +1,17 @@ -const rewire = require("rewire") -const app = rewire('./app.js') +const rewire = require("rewire"); +const app = rewire("./app.js"); +test("numLimit function must exist.", () => { + const numLimit = app.__get__("numLimit"); + expect(numLimit).toBeTruthy(); +}); -test('findVowels function must exist.', ()=>{ - const findVowels = app.__get__('findVowels') - expect(findVowels).toBeTruthy(); -}) +test("The missing angle is correctly classified.", () => { + const numLimit = app.__get__("numLimit"); -test('You must have the correct number of vowels', ()=>{ - const findVowels = app.__get__("findVowels"); - - expect(findVowels("carola")).toBe(3) - expect(findVowels("youtube")).toBe(4) -}) \ No newline at end of file + expect(numLimit(25, 30, 50)).toBe(30); + expect(numLimit(17,10, 71)).toBe(17); + expect(numLimit(102, 26, 90)).toBe(102); + expect(numLimit(54, 36, 54)).toBe(54); + expect(numLimit(24, 24, 47)).toBe(24); +}); From 54304137e195001632a3b9606779bcc4b03aaf85 Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 21:25:35 -0400 Subject: [PATCH 10/28] Test for exercise 09 done --- 09-FormatPhoneNumber/test.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/09-FormatPhoneNumber/test.js b/09-FormatPhoneNumber/test.js index 7618d7f..28e4204 100644 --- a/09-FormatPhoneNumber/test.js +++ b/09-FormatPhoneNumber/test.js @@ -1,15 +1,15 @@ -const rewire = require("rewire") -const app = rewire('./app.js') +const rewire = require("rewire"); +const app = rewire("./app.js"); +test("formatPhoneNumber function must exist.", () => { + const formatPhoneNumber = app.__get__("formatPhoneNumber"); + expect(formatPhoneNumber).toBeTruthy(); +}); -test('findVowels function must exist.', ()=>{ - const findVowels = app.__get__('findVowels') - expect(findVowels).toBeTruthy(); -}) +test("Phone number must be formatted correctly.", () => { + const formatPhoneNumber = app.__get__("formatPhoneNumber"); -test('You must have the correct number of vowels', ()=>{ - const findVowels = app.__get__("findVowels"); - - expect(findVowels("carola")).toBe(3) - expect(findVowels("youtube")).toBe(4) -}) \ No newline at end of file + expect(formatPhoneNumber([7,8,6,7,4,0,2,3,1,4])).toBe("(786) 740-2314"); + expect(formatPhoneNumber([5,1,2,4,6,0,0,1,0,4])).toBe("(512) 460-0104"); + expect(formatPhoneNumber([8,8,1,6,2,0,2,5,1,7])).toBe("(881) 620-2517"); +}); From c4c16bb5c9c589e4d9e7e12d8cd83ca50c2557b2 Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 21:30:01 -0400 Subject: [PATCH 11/28] Test for exercise 10 done --- 10-ShareCake/test.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/10-ShareCake/test.js b/10-ShareCake/test.js index 7618d7f..ac3f34d 100644 --- a/10-ShareCake/test.js +++ b/10-ShareCake/test.js @@ -1,15 +1,15 @@ -const rewire = require("rewire") -const app = rewire('./app.js') +const rewire = require("rewire"); +const app = rewire("./app.js"); +test("sliceOfCake function must exist.", () => { + const sliceOfCake = app.__get__("sliceOfCake"); + expect(sliceOfCake).toBeTruthy(); +}); -test('findVowels function must exist.', ()=>{ - const findVowels = app.__get__('findVowels') - expect(findVowels).toBeTruthy(); -}) +test("Phone number must be formatted correctly.", () => { + const sliceOfCake = app.__get__("sliceOfCake"); -test('You must have the correct number of vowels', ()=>{ - const findVowels = app.__get__("findVowels"); - - expect(findVowels("carola")).toBe(3) - expect(findVowels("youtube")).toBe(4) -}) \ No newline at end of file + expect(sliceOfCake(20, 5, 1)).toBe(true); + expect(sliceOfCake(64, 17, 10)).toBe(false); + expect(sliceOfCake(400, 45, 3)).toBe(true); +}); \ No newline at end of file From 25697f600c047a5001a27dbc3530991a880ca522 Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 22:02:14 -0400 Subject: [PATCH 12/28] All tests checked and working properly. --- .learn/reports/05-AreaOfTriangle.json | 21 +++++++++++++++++++++ .learn/reports/06-LongestWord.json | 21 +++++++++++++++++++++ .learn/reports/07-MissingAngle.json | 21 +++++++++++++++++++++ .learn/reports/08-NumberLimit.json | 21 +++++++++++++++++++++ .learn/reports/09-FormatPhoneNumber.json | 21 +++++++++++++++++++++ .learn/reports/10-ShareCake.json | 21 +++++++++++++++++++++ .learn/resets/05-AreaOfTriangle/app.js | 1 + .learn/resets/06-LongestWord/app.js | 1 + .learn/resets/07-MissingAngle/app.js | 1 + .learn/resets/08-NumberLimit/app.js | 1 + .learn/resets/09-FormatPhoneNumber/app.js | 1 + .learn/resets/10-ShareCake/app.js | 1 + .learn/vscode_queue.json | 2 +- 05-AreaOfTriangle/app.js | 4 ++++ 06-LongestWord/app.js | 13 +++++++++++++ 07-MissingAngle/app.js | 11 +++++++++++ 08-NumberLimit/app.js | 10 ++++++++++ 08-NumberLimit/test.js | 2 +- 09-FormatPhoneNumber/app.js | 7 +++++++ 09-FormatPhoneNumber/test.js | 6 +++--- 10-ShareCake/app.js | 4 ++++ 21 files changed, 186 insertions(+), 5 deletions(-) create mode 100644 .learn/reports/05-AreaOfTriangle.json create mode 100644 .learn/reports/06-LongestWord.json create mode 100644 .learn/reports/07-MissingAngle.json create mode 100644 .learn/reports/08-NumberLimit.json create mode 100644 .learn/reports/09-FormatPhoneNumber.json create mode 100644 .learn/reports/10-ShareCake.json create mode 100644 .learn/resets/05-AreaOfTriangle/app.js create mode 100644 .learn/resets/06-LongestWord/app.js create mode 100644 .learn/resets/07-MissingAngle/app.js create mode 100644 .learn/resets/08-NumberLimit/app.js create mode 100644 .learn/resets/09-FormatPhoneNumber/app.js create mode 100644 .learn/resets/10-ShareCake/app.js diff --git a/.learn/reports/05-AreaOfTriangle.json b/.learn/reports/05-AreaOfTriangle.json new file mode 100644 index 0000000..2b490b6 --- /dev/null +++ b/.learn/reports/05-AreaOfTriangle.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "AreaOfTriangle function must exist.", + "status": "passed" + }, + { + "title": "The base for the triangle is correct", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/06-LongestWord.json b/.learn/reports/06-LongestWord.json new file mode 100644 index 0000000..9366186 --- /dev/null +++ b/.learn/reports/06-LongestWord.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "longestWord function must exist.", + "status": "passed" + }, + { + "title": "You should return the longest word", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/07-MissingAngle.json b/.learn/reports/07-MissingAngle.json new file mode 100644 index 0000000..4b8a02c --- /dev/null +++ b/.learn/reports/07-MissingAngle.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "missingAngle function must exist.", + "status": "passed" + }, + { + "title": "The missing angle is correctly classified.", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/08-NumberLimit.json b/.learn/reports/08-NumberLimit.json new file mode 100644 index 0000000..1482fcc --- /dev/null +++ b/.learn/reports/08-NumberLimit.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "numLimit function must exist.", + "status": "passed" + }, + { + "title": "The missing angle is correctly classified.", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/09-FormatPhoneNumber.json b/.learn/reports/09-FormatPhoneNumber.json new file mode 100644 index 0000000..f42866a --- /dev/null +++ b/.learn/reports/09-FormatPhoneNumber.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "formatPhoneNumber function must exist.", + "status": "passed" + }, + { + "title": "Phone number must be formatted correctly.", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/10-ShareCake.json b/.learn/reports/10-ShareCake.json new file mode 100644 index 0000000..1b6ae32 --- /dev/null +++ b/.learn/reports/10-ShareCake.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "sliceOfCake function must exist.", + "status": "passed" + }, + { + "title": "Phone number must be formatted correctly.", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/resets/05-AreaOfTriangle/app.js b/.learn/resets/05-AreaOfTriangle/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/.learn/resets/05-AreaOfTriangle/app.js @@ -0,0 +1 @@ +// your code here diff --git a/.learn/resets/06-LongestWord/app.js b/.learn/resets/06-LongestWord/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/.learn/resets/06-LongestWord/app.js @@ -0,0 +1 @@ +// your code here diff --git a/.learn/resets/07-MissingAngle/app.js b/.learn/resets/07-MissingAngle/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/.learn/resets/07-MissingAngle/app.js @@ -0,0 +1 @@ +// your code here diff --git a/.learn/resets/08-NumberLimit/app.js b/.learn/resets/08-NumberLimit/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/.learn/resets/08-NumberLimit/app.js @@ -0,0 +1 @@ +// your code here diff --git a/.learn/resets/09-FormatPhoneNumber/app.js b/.learn/resets/09-FormatPhoneNumber/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/.learn/resets/09-FormatPhoneNumber/app.js @@ -0,0 +1 @@ +// your code here diff --git a/.learn/resets/10-ShareCake/app.js b/.learn/resets/10-ShareCake/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/.learn/resets/10-ShareCake/app.js @@ -0,0 +1 @@ +// your code here diff --git a/.learn/vscode_queue.json b/.learn/vscode_queue.json index 9ab51d6..48c7171 100644 --- a/.learn/vscode_queue.json +++ b/.learn/vscode_queue.json @@ -1 +1 @@ -[{"name":"initializing","time":158262652.875},{"name":"reset","time":158262673.5},{"name":"configuration_loaded","time":158266763.458},{"name":"start_exercise","time":157799868.416,"data":"01-AreaOfTriangle"},{"name":"open_files","time":157833631.416,"data":["01-AreaOfTriangle/app.js"]},{"name":"open_files","time":158120033.583,"data":["01-AreaOfTriangle/app.js"]},{"name":"open_files","time":158457778.041,"data":["01-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":158457658.958,"data":"02-CompareStrings"},{"name":"open_files","time":158462296,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":157571677.75,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":158025960.875,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":157862341.625,"data":"03-DivisibleBy5"},{"name":"open_files","time":157868347.25,"data":["03-DivisibleBy5/app.js"]},{"name":"open_files","time":158054669.75,"data":["03-DivisibleBy5/app.js"]},{"name":"open_files","time":158457209.583,"data":["03-DivisibleBy5/app.js"]},{"name":"start_exercise","time":157840373.583,"data":"04-VowelCount"},{"name":"open_files","time":157844680.625,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":158376354.083,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":158815933.458,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163135410.416,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163324334.166,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163264203.166,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162989777.208,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162703983.625,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162524171.916,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163252458.125,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162475878.875,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162789428.833,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163176607.291,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162512713.5,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162505540.916,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163162659.875,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163310188.791,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163027328.208,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163218804.958,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163382457.166,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":162511435.666,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163056148.958,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":163011568.916,"data":["04-VowelCount/app.js"]}] \ No newline at end of file +[{"name":"initializing","time":174013133.916},{"name":"reset","time":174013151.875},{"name":"configuration_loaded","time":174018463.166},{"name":"open_files","time":173621195.375,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":173695916.583,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":173631298.375,"data":["04-VowelCount/app.js"]},{"name":"start_exercise","time":173913355.583,"data":"05-AreaOfTriangle"},{"name":"open_files","time":173918553.291,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":174100302.416,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":174101360.833,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":173771402.125,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":174455123.75,"data":["05-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":174534267.541,"data":"06-LongestWord"},{"name":"open_files","time":174541544.708,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173752950,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174529194.125,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174392085.291,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173796741.666,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173922845.666,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173995895.25,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174200359.625,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174583654.291,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174105934.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174264781.75,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173923467.5,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174208037.375,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174014963.166,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174010703.666,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174034127.791,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174126441.791,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174396668.083,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173768072.208,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174453706.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173979465.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174023852.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174066271.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173791978.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174225263,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174055351.041,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174660294.083,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174145448.208,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174558647.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173932560.708,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174238040.541,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174462780.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174728044.208,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173912257.541,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174058583.291,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173928296.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174167400.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174082314.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174187736.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174190167.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174350333.291,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174852702.083,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174833378.708,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174963494.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174662262.25,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174348327.583,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174912316.583,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":175113153.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174344436.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174266650.583,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174413494.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174456570,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":175157157.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174339041,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174745495.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174808655.625,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174486327.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174957835.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174361539.541,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174635161.083,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174387924.166,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":175141375.875,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174813059.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":175061603.666,"data":["06-LongestWord/app.js"]},{"name":"start_exercise","time":175604952.375,"data":"07-MissingAngle"},{"name":"open_files","time":175612142.625,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174928281.791,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174853810.916,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174934454.75,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174808779.958,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174959614.666,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174866657.625,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174770465.375,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":175018404.5,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":175038229.416,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":175015871.791,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":175659627.791,"data":["07-MissingAngle/app.js"]},{"name":"start_exercise","time":174884899.25,"data":"08-NumberLimit"},{"name":"open_files","time":174889803.125,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175118406.125,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":174821971.416,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175257539.166,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175284002.333,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175326055.166,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":174778618.375,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175093265.958,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175572575.333,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175618837.166,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175690989.541,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175675723.708,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175024238.5,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175012068.541,"data":["08-NumberLimit/app.js"]},{"name":"start_exercise","time":175884589.958,"data":"09-FormatPhoneNumber"},{"name":"open_files","time":174891614.583,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175119865.041,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175203881.333,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":174917983.5,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175498524.5,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":174998190.166,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175656960.5,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175532573.375,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175510151.875,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175477123.125,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175374171.041,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175974755.75,"data":["09-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":175868225.416,"data":"10-ShareCake"},{"name":"open_files","time":175876369.041,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":176102289.75,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":175548286.083,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":175754315.625,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":176273924,"data":["10-ShareCake/app.js"]}] \ No newline at end of file diff --git a/05-AreaOfTriangle/app.js b/05-AreaOfTriangle/app.js index 3e203df..1260e85 100644 --- a/05-AreaOfTriangle/app.js +++ b/05-AreaOfTriangle/app.js @@ -1 +1,5 @@ // your code here +function AreaOfTriangle(b, h) { + const result = (b * h) / 2; + return result; +} \ No newline at end of file diff --git a/06-LongestWord/app.js b/06-LongestWord/app.js index 3e203df..60ae418 100644 --- a/06-LongestWord/app.js +++ b/06-LongestWord/app.js @@ -1 +1,14 @@ // your code here + +function longestWord(sen) { + let str = sen.split(" "); + let longest = 0; + sen = null; + for (let i = 0; i < str.length; i++) { + if (longest < str[i].length) { + longest = str[i].length; + sen = str[i]; + } + } + return sen +} \ No newline at end of file diff --git a/07-MissingAngle/app.js b/07-MissingAngle/app.js index 3e203df..90e6980 100644 --- a/07-MissingAngle/app.js +++ b/07-MissingAngle/app.js @@ -1 +1,12 @@ // your code here +const missingAngle = (degree1, degree2) => { + const result = 180 - (degree1 + degree2); + switch (true) { + case result < 90: + return ("Acute"); + case result === 90: + return ("Right"); + case result >= 90: + return ("Obtuse"); + } +}; \ No newline at end of file diff --git a/08-NumberLimit/app.js b/08-NumberLimit/app.js index 3e203df..e4b435b 100644 --- a/08-NumberLimit/app.js +++ b/08-NumberLimit/app.js @@ -1 +1,11 @@ // your code here +const numLimit = (num, lowest, highest) => { + switch (true) { + case num >= lowest && num <= highest: + return (num); + case num < lowest: + return (lowest); + case num > highest: + return (highest); + } +}; \ No newline at end of file diff --git a/08-NumberLimit/test.js b/08-NumberLimit/test.js index d85a310..3f8045b 100644 --- a/08-NumberLimit/test.js +++ b/08-NumberLimit/test.js @@ -11,7 +11,7 @@ test("The missing angle is correctly classified.", () => { expect(numLimit(25, 30, 50)).toBe(30); expect(numLimit(17,10, 71)).toBe(17); - expect(numLimit(102, 26, 90)).toBe(102); + expect(numLimit(102, 26, 90)).toBe(90); expect(numLimit(54, 36, 54)).toBe(54); expect(numLimit(24, 24, 47)).toBe(24); }); diff --git a/09-FormatPhoneNumber/app.js b/09-FormatPhoneNumber/app.js index 3e203df..49ab26f 100644 --- a/09-FormatPhoneNumber/app.js +++ b/09-FormatPhoneNumber/app.js @@ -1 +1,8 @@ // your code here +function formatPhoneNumber(numbers) { + const args = Array.prototype.slice.call(arguments); + args.splice(6, 0, "-"); + args.splice(3, 0, ") "); + args.splice(0, 0, "("); + return (args.join("")); +} \ No newline at end of file diff --git a/09-FormatPhoneNumber/test.js b/09-FormatPhoneNumber/test.js index 28e4204..f5cf72b 100644 --- a/09-FormatPhoneNumber/test.js +++ b/09-FormatPhoneNumber/test.js @@ -9,7 +9,7 @@ test("formatPhoneNumber function must exist.", () => { test("Phone number must be formatted correctly.", () => { const formatPhoneNumber = app.__get__("formatPhoneNumber"); - expect(formatPhoneNumber([7,8,6,7,4,0,2,3,1,4])).toBe("(786) 740-2314"); - expect(formatPhoneNumber([5,1,2,4,6,0,0,1,0,4])).toBe("(512) 460-0104"); - expect(formatPhoneNumber([8,8,1,6,2,0,2,5,1,7])).toBe("(881) 620-2517"); + expect(formatPhoneNumber(7,8,6,7,4,0,2,3,1,4)).toBe("(786) 740-2314"); + expect(formatPhoneNumber(5,1,2,4,6,0,0,1,0,4)).toBe("(512) 460-0104"); + expect(formatPhoneNumber(8,8,1,6,2,0,2,5,1,7)).toBe("(881) 620-2517"); }); diff --git a/10-ShareCake/app.js b/10-ShareCake/app.js index 3e203df..050694f 100644 --- a/10-ShareCake/app.js +++ b/10-ShareCake/app.js @@ -1 +1,5 @@ // your code here +const sliceOfCake = (totalSlices, recipients, slicesPerPerson) => { + const result = recipients * slicesPerPerson < totalSlices ? true : false; + return result; +}; \ No newline at end of file From d5b0d0f3b7e1458d065bc5479ec7e6e36f31df99 Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 19 Jun 2022 22:09:15 -0400 Subject: [PATCH 13/28] Removed solution from app.js files and added them to solution.hide.js files --- .learn/resets/01-CheckNums/app.js | 1 + .learn/vscode_queue.json | 2 +- 01-CheckNums/app.js | 3 --- 01-CheckNums/solution.hide.js | 4 ++++ 02-CompareStrings/app.js | 7 ------- 02-CompareStrings/solution.hide.js | 8 ++++++++ 03-DivisibleBy5/app.js | 3 --- 03-DivisibleBy5/solution.hide.js | 4 ++++ 04-VowelCount/app.js | 4 ---- 04-VowelCount/solution.hide.js | 5 +++++ 05-AreaOfTriangle/app.js | 4 ---- 05-AreaOfTriangle/solution.hide.js | 5 +++++ 06-LongestWord/app.js | 12 ------------ 06-LongestWord/solution.hide.js | 13 +++++++++++++ 07-MissingAngle/app.js | 11 ----------- 07-MissingAngle/solution.hide.js | 12 ++++++++++++ 08-NumberLimit/app.js | 10 ---------- 08-NumberLimit/solution.hide.js | 11 +++++++++++ 09-FormatPhoneNumber/app.js | 7 ------- 09-FormatPhoneNumber/solution.hide.js | 8 ++++++++ 10-ShareCake/app.js | 4 ---- 10-ShareCake/solution.hide.js | 5 +++++ 22 files changed, 77 insertions(+), 66 deletions(-) create mode 100644 .learn/resets/01-CheckNums/app.js create mode 100644 01-CheckNums/solution.hide.js create mode 100644 02-CompareStrings/solution.hide.js create mode 100644 03-DivisibleBy5/solution.hide.js create mode 100644 04-VowelCount/solution.hide.js create mode 100644 05-AreaOfTriangle/solution.hide.js create mode 100644 06-LongestWord/solution.hide.js create mode 100644 07-MissingAngle/solution.hide.js create mode 100644 08-NumberLimit/solution.hide.js create mode 100644 09-FormatPhoneNumber/solution.hide.js create mode 100644 10-ShareCake/solution.hide.js diff --git a/.learn/resets/01-CheckNums/app.js b/.learn/resets/01-CheckNums/app.js new file mode 100644 index 0000000..3e203df --- /dev/null +++ b/.learn/resets/01-CheckNums/app.js @@ -0,0 +1 @@ +// your code here diff --git a/.learn/vscode_queue.json b/.learn/vscode_queue.json index 48c7171..42e5d86 100644 --- a/.learn/vscode_queue.json +++ b/.learn/vscode_queue.json @@ -1 +1 @@ -[{"name":"initializing","time":174013133.916},{"name":"reset","time":174013151.875},{"name":"configuration_loaded","time":174018463.166},{"name":"open_files","time":173621195.375,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":173695916.583,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":173631298.375,"data":["04-VowelCount/app.js"]},{"name":"start_exercise","time":173913355.583,"data":"05-AreaOfTriangle"},{"name":"open_files","time":173918553.291,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":174100302.416,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":174101360.833,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":173771402.125,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":174455123.75,"data":["05-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":174534267.541,"data":"06-LongestWord"},{"name":"open_files","time":174541544.708,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173752950,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174529194.125,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174392085.291,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173796741.666,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173922845.666,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173995895.25,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174200359.625,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174583654.291,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174105934.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174264781.75,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173923467.5,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174208037.375,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174014963.166,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174010703.666,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174034127.791,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174126441.791,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174396668.083,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173768072.208,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174453706.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173979465.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174023852.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174066271.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173791978.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174225263,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174055351.041,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174660294.083,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174145448.208,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174558647.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173932560.708,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174238040.541,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174462780.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174728044.208,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173912257.541,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174058583.291,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":173928296.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174167400.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174082314.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174187736.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174190167.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174350333.291,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174852702.083,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174833378.708,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174963494.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174662262.25,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174348327.583,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174912316.583,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":175113153.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174344436.958,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174266650.583,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174413494.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174456570,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":175157157.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174339041,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174745495.416,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174808655.625,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174486327.458,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174957835.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174361539.541,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174635161.083,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174387924.166,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":175141375.875,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":174813059.333,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":175061603.666,"data":["06-LongestWord/app.js"]},{"name":"start_exercise","time":175604952.375,"data":"07-MissingAngle"},{"name":"open_files","time":175612142.625,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174928281.791,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174853810.916,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174934454.75,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174808779.958,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174959614.666,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174866657.625,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":174770465.375,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":175018404.5,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":175038229.416,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":175015871.791,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":175659627.791,"data":["07-MissingAngle/app.js"]},{"name":"start_exercise","time":174884899.25,"data":"08-NumberLimit"},{"name":"open_files","time":174889803.125,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175118406.125,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":174821971.416,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175257539.166,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175284002.333,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175326055.166,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":174778618.375,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175093265.958,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175572575.333,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175618837.166,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175690989.541,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175675723.708,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175024238.5,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":175012068.541,"data":["08-NumberLimit/app.js"]},{"name":"start_exercise","time":175884589.958,"data":"09-FormatPhoneNumber"},{"name":"open_files","time":174891614.583,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175119865.041,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175203881.333,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":174917983.5,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175498524.5,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":174998190.166,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175656960.5,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175532573.375,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175510151.875,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175477123.125,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175374171.041,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":175974755.75,"data":["09-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":175868225.416,"data":"10-ShareCake"},{"name":"open_files","time":175876369.041,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":176102289.75,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":175548286.083,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":175754315.625,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":176273924,"data":["10-ShareCake/app.js"]}] \ No newline at end of file +[{"name":"initializing","time":175927247.5},{"name":"reset","time":175927265.583},{"name":"configuration_loaded","time":175931375.666},{"name":"start_exercise","time":176625545.083,"data":"01-CheckNums"},{"name":"open_files","time":176638696.958,"data":["01-CheckNums/app.js"]},{"name":"open_files","time":175859619.125,"data":["01-CheckNums/app.js"]},{"name":"start_exercise","time":176403691.125,"data":"02-CompareStrings"},{"name":"open_files","time":176411043,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":176646921.25,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":176372862.625,"data":"03-DivisibleBy5"},{"name":"open_files","time":176378955.125,"data":["03-DivisibleBy5/app.js"]},{"name":"open_files","time":176612422.5,"data":["03-DivisibleBy5/app.js"]},{"name":"start_exercise","time":176759241.916,"data":"04-VowelCount"},{"name":"open_files","time":176764713.458,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":175975106.416,"data":["04-VowelCount/app.js"]},{"name":"start_exercise","time":176012973.708,"data":"05-AreaOfTriangle"},{"name":"open_files","time":176022667.625,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":176247003.833,"data":["05-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":176300067.5,"data":"06-LongestWord"},{"name":"open_files","time":176307234.625,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":176518467.291,"data":["06-LongestWord/app.js"]},{"name":"start_exercise","time":176603448.458,"data":"07-MissingAngle"},{"name":"open_files","time":176609917.583,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":176748017.333,"data":["07-MissingAngle/app.js"]},{"name":"start_exercise","time":176799556.208,"data":"08-NumberLimit"},{"name":"open_files","time":176809748.791,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":176022611.5,"data":["08-NumberLimit/app.js"]},{"name":"start_exercise","time":176796898.958,"data":"09-FormatPhoneNumber"},{"name":"open_files","time":176802451.25,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":176024025.666,"data":["09-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":175934750.916,"data":"10-ShareCake"},{"name":"open_files","time":175943906.375,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":176156786.25,"data":["10-ShareCake/app.js"]}] \ No newline at end of file diff --git a/01-CheckNums/app.js b/01-CheckNums/app.js index 4b97e77..3e203df 100644 --- a/01-CheckNums/app.js +++ b/01-CheckNums/app.js @@ -1,4 +1 @@ // your code here -function checkNums(num1, num2){ - return num2 > num1 ? true : num1 > num2 ? false : -1; -} \ No newline at end of file diff --git a/01-CheckNums/solution.hide.js b/01-CheckNums/solution.hide.js new file mode 100644 index 0000000..956d645 --- /dev/null +++ b/01-CheckNums/solution.hide.js @@ -0,0 +1,4 @@ +// your code here +function checkNums(num1, num2) { + return num2 > num1 ? true : num1 > num2 ? false : -1; +} \ No newline at end of file diff --git a/02-CompareStrings/app.js b/02-CompareStrings/app.js index fc789ff..3e203df 100644 --- a/02-CompareStrings/app.js +++ b/02-CompareStrings/app.js @@ -1,8 +1 @@ // your code here -function compareStrings(string1, string2) { - if (string1.length === string2.length) { - return true - } else { - return false - } -} \ No newline at end of file diff --git a/02-CompareStrings/solution.hide.js b/02-CompareStrings/solution.hide.js new file mode 100644 index 0000000..0caccc9 --- /dev/null +++ b/02-CompareStrings/solution.hide.js @@ -0,0 +1,8 @@ +// your code here +function compareStrings(string1, string2) { + if (string1.length === string2.length) { + return true; + } else { + return false; + } +} \ No newline at end of file diff --git a/03-DivisibleBy5/app.js b/03-DivisibleBy5/app.js index d3029b7..3e203df 100644 --- a/03-DivisibleBy5/app.js +++ b/03-DivisibleBy5/app.js @@ -1,4 +1 @@ // your code here - function divisibleBy5(int) { - return int % 5 === 0 ? true : false; - } \ No newline at end of file diff --git a/03-DivisibleBy5/solution.hide.js b/03-DivisibleBy5/solution.hide.js new file mode 100644 index 0000000..d3029b7 --- /dev/null +++ b/03-DivisibleBy5/solution.hide.js @@ -0,0 +1,4 @@ +// your code here + function divisibleBy5(int) { + return int % 5 === 0 ? true : false; + } \ No newline at end of file diff --git a/04-VowelCount/app.js b/04-VowelCount/app.js index 5702e41..3e203df 100644 --- a/04-VowelCount/app.js +++ b/04-VowelCount/app.js @@ -1,5 +1 @@ // your code here -function findVowels(word){ - const matched = word.match(/[aeiou]/gi); - return matched ? matched.length : 0; -} \ No newline at end of file diff --git a/04-VowelCount/solution.hide.js b/04-VowelCount/solution.hide.js new file mode 100644 index 0000000..d26d142 --- /dev/null +++ b/04-VowelCount/solution.hide.js @@ -0,0 +1,5 @@ +// your code here +function findVowels(word) { + const matched = word.match(/[aeiou]/gi); + return matched ? matched.length : 0; +} \ No newline at end of file diff --git a/05-AreaOfTriangle/app.js b/05-AreaOfTriangle/app.js index 1260e85..3e203df 100644 --- a/05-AreaOfTriangle/app.js +++ b/05-AreaOfTriangle/app.js @@ -1,5 +1 @@ // your code here -function AreaOfTriangle(b, h) { - const result = (b * h) / 2; - return result; -} \ No newline at end of file diff --git a/05-AreaOfTriangle/solution.hide.js b/05-AreaOfTriangle/solution.hide.js new file mode 100644 index 0000000..1260e85 --- /dev/null +++ b/05-AreaOfTriangle/solution.hide.js @@ -0,0 +1,5 @@ +// your code here +function AreaOfTriangle(b, h) { + const result = (b * h) / 2; + return result; +} \ No newline at end of file diff --git a/06-LongestWord/app.js b/06-LongestWord/app.js index 60ae418..a439b9a 100644 --- a/06-LongestWord/app.js +++ b/06-LongestWord/app.js @@ -1,14 +1,2 @@ // your code here -function longestWord(sen) { - let str = sen.split(" "); - let longest = 0; - sen = null; - for (let i = 0; i < str.length; i++) { - if (longest < str[i].length) { - longest = str[i].length; - sen = str[i]; - } - } - return sen -} \ No newline at end of file diff --git a/06-LongestWord/solution.hide.js b/06-LongestWord/solution.hide.js new file mode 100644 index 0000000..fbb374d --- /dev/null +++ b/06-LongestWord/solution.hide.js @@ -0,0 +1,13 @@ +// your code here +function longestWord(sen) { + let str = sen.split(" "); + let longest = 0; + sen = null; + for (let i = 0; i < str.length; i++) { + if (longest < str[i].length) { + longest = str[i].length; + sen = str[i]; + } + } + return sen; +} \ No newline at end of file diff --git a/07-MissingAngle/app.js b/07-MissingAngle/app.js index 90e6980..3e203df 100644 --- a/07-MissingAngle/app.js +++ b/07-MissingAngle/app.js @@ -1,12 +1 @@ // your code here -const missingAngle = (degree1, degree2) => { - const result = 180 - (degree1 + degree2); - switch (true) { - case result < 90: - return ("Acute"); - case result === 90: - return ("Right"); - case result >= 90: - return ("Obtuse"); - } -}; \ No newline at end of file diff --git a/07-MissingAngle/solution.hide.js b/07-MissingAngle/solution.hide.js new file mode 100644 index 0000000..525cfca --- /dev/null +++ b/07-MissingAngle/solution.hide.js @@ -0,0 +1,12 @@ +// your code here +const missingAngle = (degree1, degree2) => { + const result = 180 - (degree1 + degree2); + switch (true) { + case result < 90: + return "Acute"; + case result === 90: + return "Right"; + case result >= 90: + return "Obtuse"; + } +}; diff --git a/08-NumberLimit/app.js b/08-NumberLimit/app.js index e4b435b..3e203df 100644 --- a/08-NumberLimit/app.js +++ b/08-NumberLimit/app.js @@ -1,11 +1 @@ // your code here -const numLimit = (num, lowest, highest) => { - switch (true) { - case num >= lowest && num <= highest: - return (num); - case num < lowest: - return (lowest); - case num > highest: - return (highest); - } -}; \ No newline at end of file diff --git a/08-NumberLimit/solution.hide.js b/08-NumberLimit/solution.hide.js new file mode 100644 index 0000000..1b62059 --- /dev/null +++ b/08-NumberLimit/solution.hide.js @@ -0,0 +1,11 @@ +// your code here +const numLimit = (num, lowest, highest) => { + switch (true) { + case num >= lowest && num <= highest: + return num; + case num < lowest: + return lowest; + case num > highest: + return highest; + } +}; diff --git a/09-FormatPhoneNumber/app.js b/09-FormatPhoneNumber/app.js index 49ab26f..3e203df 100644 --- a/09-FormatPhoneNumber/app.js +++ b/09-FormatPhoneNumber/app.js @@ -1,8 +1 @@ // your code here -function formatPhoneNumber(numbers) { - const args = Array.prototype.slice.call(arguments); - args.splice(6, 0, "-"); - args.splice(3, 0, ") "); - args.splice(0, 0, "("); - return (args.join("")); -} \ No newline at end of file diff --git a/09-FormatPhoneNumber/solution.hide.js b/09-FormatPhoneNumber/solution.hide.js new file mode 100644 index 0000000..fb019b9 --- /dev/null +++ b/09-FormatPhoneNumber/solution.hide.js @@ -0,0 +1,8 @@ +// your code here +function formatPhoneNumber(numbers) { + const args = Array.prototype.slice.call(arguments); + args.splice(6, 0, "-"); + args.splice(3, 0, ") "); + args.splice(0, 0, "("); + return args.join(""); +} diff --git a/10-ShareCake/app.js b/10-ShareCake/app.js index 050694f..3e203df 100644 --- a/10-ShareCake/app.js +++ b/10-ShareCake/app.js @@ -1,5 +1 @@ // your code here -const sliceOfCake = (totalSlices, recipients, slicesPerPerson) => { - const result = recipients * slicesPerPerson < totalSlices ? true : false; - return result; -}; \ No newline at end of file diff --git a/10-ShareCake/solution.hide.js b/10-ShareCake/solution.hide.js new file mode 100644 index 0000000..23e80ee --- /dev/null +++ b/10-ShareCake/solution.hide.js @@ -0,0 +1,5 @@ +// your code here +const sliceOfCake = (totalSlices, recipients, slicesPerPerson) => { + const result = recipients * slicesPerPerson < totalSlices ? true : false; + return result; +}; From 9c696ef49a6987de5442796b082820dfac951018 Mon Sep 17 00:00:00 2001 From: umikami Date: Tue, 21 Jun 2022 17:18:35 -0400 Subject: [PATCH 14/28] Added folder and base files for the last 10 excercises to make a total of 20 exercises --- 11-ConcatenateArrays/README.es.md | 3 +++ 11-ConcatenateArrays/README.md | 3 +++ 11-ConcatenateArrays/app.js | 0 11-ConcatenateArrays/solution.hide.js | 0 11-ConcatenateArrays/test.js | 0 5 files changed, 6 insertions(+) create mode 100644 11-ConcatenateArrays/README.es.md create mode 100644 11-ConcatenateArrays/README.md create mode 100644 11-ConcatenateArrays/app.js create mode 100644 11-ConcatenateArrays/solution.hide.js create mode 100644 11-ConcatenateArrays/test.js diff --git a/11-ConcatenateArrays/README.es.md b/11-ConcatenateArrays/README.es.md new file mode 100644 index 0000000..68e52f0 --- /dev/null +++ b/11-ConcatenateArrays/README.es.md @@ -0,0 +1,3 @@ +# `11` Concatenate Arrays + +# Instrucciones 🗒 \ No newline at end of file diff --git a/11-ConcatenateArrays/README.md b/11-ConcatenateArrays/README.md new file mode 100644 index 0000000..8d0fed8 --- /dev/null +++ b/11-ConcatenateArrays/README.md @@ -0,0 +1,3 @@ +# `11` Concatenate Arrays + +# Instructions 🗒 \ No newline at end of file diff --git a/11-ConcatenateArrays/app.js b/11-ConcatenateArrays/app.js new file mode 100644 index 0000000..e69de29 diff --git a/11-ConcatenateArrays/solution.hide.js b/11-ConcatenateArrays/solution.hide.js new file mode 100644 index 0000000..e69de29 diff --git a/11-ConcatenateArrays/test.js b/11-ConcatenateArrays/test.js new file mode 100644 index 0000000..e69de29 From ac437324aa0692d18cd3e6d8e43a9d8bd7c349ed Mon Sep 17 00:00:00 2001 From: umikami Date: Thu, 23 Jun 2022 15:25:57 -0400 Subject: [PATCH 15/28] Added tests for 11-15 and fixed respective README --- .learn/reports/11-ConcatenateArrays.json | 21 ++++ .learn/reports/12-DateTime.json | 33 ++++++ .learn/reports/13-Factorial.json | 21 ++++ .learn/reports/14-Fibonacci.json | 25 +++++ .learn/reports/15-FizzBuzz.json | 17 +++ .learn/resets/11-ConcatenateArrays/app.js | 0 .learn/resets/12-DateTime/app.js | 0 .learn/resets/13-Factorial/app.js | 0 .learn/resets/14-Fibonacci/app.js | 1 + .learn/resets/15-FizzBuzz/app.js | 0 .learn/vscode_queue.json | 2 +- 06-LongestWord/app.js | 1 - 11-ConcatenateArrays/README.es.md | 4 +- 11-ConcatenateArrays/README.md | 4 +- 11-ConcatenateArrays/app.js | 1 + 11-ConcatenateArrays/solution.hide.js | 4 + 11-ConcatenateArrays/test.js | 14 +++ 12-DateTime/README.es.md | 6 + 12-DateTime/README.md | 7 ++ 12-DateTime/app.js | 1 + 12-DateTime/solution.hide.js | 7 ++ 12-DateTime/test.js | 24 ++++ 13-Factorial/README.es.md | 9 ++ 13-Factorial/README.md | 9 ++ 13-Factorial/app.js | 1 + 13-Factorial/solution.hide.js | 12 ++ 13-Factorial/test.js | 15 +++ 14-Fibonacci/README.es.md | 5 + 14-Fibonacci/README.md | 5 + 14-Fibonacci/app.js | 1 + 14-Fibonacci/solution.hide.js | 13 +++ 14-Fibonacci/test.js | 18 +++ 15-FizzBuzz/README.es.md | 7 ++ 15-FizzBuzz/README.md | 7 ++ 15-FizzBuzz/app.js | 1 + 15-FizzBuzz/solution.hide.js | 11 ++ 15-FizzBuzz/test.js | 128 ++++++++++++++++++++++ 37 files changed, 431 insertions(+), 4 deletions(-) create mode 100644 .learn/reports/11-ConcatenateArrays.json create mode 100644 .learn/reports/12-DateTime.json create mode 100644 .learn/reports/13-Factorial.json create mode 100644 .learn/reports/14-Fibonacci.json create mode 100644 .learn/reports/15-FizzBuzz.json create mode 100644 .learn/resets/11-ConcatenateArrays/app.js create mode 100644 .learn/resets/12-DateTime/app.js create mode 100644 .learn/resets/13-Factorial/app.js create mode 100644 .learn/resets/14-Fibonacci/app.js create mode 100644 .learn/resets/15-FizzBuzz/app.js create mode 100644 12-DateTime/README.es.md create mode 100644 12-DateTime/README.md create mode 100644 12-DateTime/app.js create mode 100644 12-DateTime/solution.hide.js create mode 100644 12-DateTime/test.js create mode 100644 13-Factorial/README.es.md create mode 100644 13-Factorial/README.md create mode 100644 13-Factorial/app.js create mode 100644 13-Factorial/solution.hide.js create mode 100644 13-Factorial/test.js create mode 100644 14-Fibonacci/README.es.md create mode 100644 14-Fibonacci/README.md create mode 100644 14-Fibonacci/app.js create mode 100644 14-Fibonacci/solution.hide.js create mode 100644 14-Fibonacci/test.js create mode 100644 15-FizzBuzz/README.es.md create mode 100644 15-FizzBuzz/README.md create mode 100644 15-FizzBuzz/app.js create mode 100644 15-FizzBuzz/solution.hide.js create mode 100644 15-FizzBuzz/test.js diff --git a/.learn/reports/11-ConcatenateArrays.json b/.learn/reports/11-ConcatenateArrays.json new file mode 100644 index 0000000..5d0be2b --- /dev/null +++ b/.learn/reports/11-ConcatenateArrays.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "concatenateIntArrays function must exist.", + "status": "passed" + }, + { + "title": "The final output should be a mix of the two arrays", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/12-DateTime.json b/.learn/reports/12-DateTime.json new file mode 100644 index 0000000..4e7a33c --- /dev/null +++ b/.learn/reports/12-DateTime.json @@ -0,0 +1,33 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 5, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "today variable must exist.", + "status": "passed" + }, + { + "title": "date variable must exist.", + "status": "passed" + }, + { + "title": "time variable must exist.", + "status": "passed" + }, + { + "title": "dateTime variable must exist.", + "status": "passed" + }, + { + "title": "today must be a date object", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/13-Factorial.json b/.learn/reports/13-Factorial.json new file mode 100644 index 0000000..40f29b9 --- /dev/null +++ b/.learn/reports/13-Factorial.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "factorialize function must exist.", + "status": "passed" + }, + { + "title": "The factorials yield the correct answer.", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/14-Fibonacci.json b/.learn/reports/14-Fibonacci.json new file mode 100644 index 0000000..6af6749 --- /dev/null +++ b/.learn/reports/14-Fibonacci.json @@ -0,0 +1,25 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 3, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "fib function must exist.", + "status": "passed" + }, + { + "title": "fib function must return all the fibonacci numbers less than or equal to 10,000", + "status": "passed" + }, + { + "title": "fib function must return all the fibonacci numbers for any other given input | Do not hard code your answer!!", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/15-FizzBuzz.json b/.learn/reports/15-FizzBuzz.json new file mode 100644 index 0000000..4cbbd32 --- /dev/null +++ b/.learn/reports/15-FizzBuzz.json @@ -0,0 +1,17 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 1, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "Your output should be printing, fizz, buzz, fizzbuzz, or just a number depending on whether that number is divisible by 3, 5, 3 & 5, or none", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/resets/11-ConcatenateArrays/app.js b/.learn/resets/11-ConcatenateArrays/app.js new file mode 100644 index 0000000..e69de29 diff --git a/.learn/resets/12-DateTime/app.js b/.learn/resets/12-DateTime/app.js new file mode 100644 index 0000000..e69de29 diff --git a/.learn/resets/13-Factorial/app.js b/.learn/resets/13-Factorial/app.js new file mode 100644 index 0000000..e69de29 diff --git a/.learn/resets/14-Fibonacci/app.js b/.learn/resets/14-Fibonacci/app.js new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/.learn/resets/14-Fibonacci/app.js @@ -0,0 +1 @@ + diff --git a/.learn/resets/15-FizzBuzz/app.js b/.learn/resets/15-FizzBuzz/app.js new file mode 100644 index 0000000..e69de29 diff --git a/.learn/vscode_queue.json b/.learn/vscode_queue.json index 42e5d86..d5fefc6 100644 --- a/.learn/vscode_queue.json +++ b/.learn/vscode_queue.json @@ -1 +1 @@ -[{"name":"initializing","time":175927247.5},{"name":"reset","time":175927265.583},{"name":"configuration_loaded","time":175931375.666},{"name":"start_exercise","time":176625545.083,"data":"01-CheckNums"},{"name":"open_files","time":176638696.958,"data":["01-CheckNums/app.js"]},{"name":"open_files","time":175859619.125,"data":["01-CheckNums/app.js"]},{"name":"start_exercise","time":176403691.125,"data":"02-CompareStrings"},{"name":"open_files","time":176411043,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":176646921.25,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":176372862.625,"data":"03-DivisibleBy5"},{"name":"open_files","time":176378955.125,"data":["03-DivisibleBy5/app.js"]},{"name":"open_files","time":176612422.5,"data":["03-DivisibleBy5/app.js"]},{"name":"start_exercise","time":176759241.916,"data":"04-VowelCount"},{"name":"open_files","time":176764713.458,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":175975106.416,"data":["04-VowelCount/app.js"]},{"name":"start_exercise","time":176012973.708,"data":"05-AreaOfTriangle"},{"name":"open_files","time":176022667.625,"data":["05-AreaOfTriangle/app.js"]},{"name":"open_files","time":176247003.833,"data":["05-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":176300067.5,"data":"06-LongestWord"},{"name":"open_files","time":176307234.625,"data":["06-LongestWord/app.js"]},{"name":"open_files","time":176518467.291,"data":["06-LongestWord/app.js"]},{"name":"start_exercise","time":176603448.458,"data":"07-MissingAngle"},{"name":"open_files","time":176609917.583,"data":["07-MissingAngle/app.js"]},{"name":"open_files","time":176748017.333,"data":["07-MissingAngle/app.js"]},{"name":"start_exercise","time":176799556.208,"data":"08-NumberLimit"},{"name":"open_files","time":176809748.791,"data":["08-NumberLimit/app.js"]},{"name":"open_files","time":176022611.5,"data":["08-NumberLimit/app.js"]},{"name":"start_exercise","time":176796898.958,"data":"09-FormatPhoneNumber"},{"name":"open_files","time":176802451.25,"data":["09-FormatPhoneNumber/app.js"]},{"name":"open_files","time":176024025.666,"data":["09-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":175934750.916,"data":"10-ShareCake"},{"name":"open_files","time":175943906.375,"data":["10-ShareCake/app.js"]},{"name":"open_files","time":176156786.25,"data":["10-ShareCake/app.js"]}] \ No newline at end of file +[{"name":"initializing","time":495613819.583},{"name":"reset","time":495613834.5},{"name":"configuration_loaded","time":495618771.541},{"name":"start_exercise","time":495027282.416,"data":"02-CompareStrings"},{"name":"open_files","time":495033373.625,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":495215059.833,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":495348547.041,"data":"03-DivisibleBy5"},{"name":"open_files","time":495354444.458,"data":["03-DivisibleBy5/app.js"]},{"name":"start_exercise","time":495506380,"data":"04-VowelCount"},{"name":"open_files","time":495519117.791,"data":["04-VowelCount/app.js"]},{"name":"start_exercise","time":495639564.875,"data":"05-AreaOfTriangle"},{"name":"open_files","time":495645479.416,"data":["05-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":494921632.166,"data":"06-LongestWord"},{"name":"open_files","time":494924919.833,"data":["06-LongestWord/app.js"]},{"name":"start_exercise","time":495064944.083,"data":"07-MissingAngle"},{"name":"open_files","time":495072722.541,"data":["07-MissingAngle/app.js"]},{"name":"start_exercise","time":495222269.833,"data":"08-NumberLimit"},{"name":"open_files","time":495226883.166,"data":["08-NumberLimit/app.js"]},{"name":"start_exercise","time":495378989.583,"data":"09-FormatPhoneNumber"},{"name":"open_files","time":495382504.625,"data":["09-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":495535955.833,"data":"10-ShareCake"},{"name":"open_files","time":495542760.166,"data":["10-ShareCake/app.js"]},{"name":"start_exercise","time":495689009.791,"data":"11-ConcatenateArrays"},{"name":"open_files","time":495692543.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"start_exercise","time":495106049.208,"data":"12-DateTime"},{"name":"open_files","time":495108888.416,"data":["12-DateTime/app.js"]},{"name":"start_exercise","time":495115797.833,"data":"11-ConcatenateArrays"},{"name":"open_files","time":495122087.041,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495282523.25,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495238312.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495688165.833,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495831017.291,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495260934.666,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495048502.958,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495634289.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495105418.541,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495759120.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495277164.291,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495513588.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495762854.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495510926.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495192628.791,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495891386.791,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495815507.625,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495684714.375,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495309414.333,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495529844.166,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495967328.625,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495892258.291,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495555856,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495211507.125,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495399197.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495997300.458,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":496084251.333,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495632748.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495913104.375,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495946748.208,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495844831.25,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495183448.25,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495666090.625,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495879898.625,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495503876.375,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495772695.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495369394.666,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495263226.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495959457.708,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495293495.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495481249.333,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495414308.083,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495892806.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495240475.708,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495550815.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":496023222.291,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495469778.833,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495534130.708,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495661384.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495596615.25,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495697821,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495516613.666,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495692708.166,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":496014158.541,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495882897.333,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495644837.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495459047.666,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495850497.5,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":496905354.708,"data":["11-ConcatenateArrays/app.js"]},{"name":"start_exercise","time":496563388.25,"data":"12-DateTime"},{"name":"open_files","time":496576072.583,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496934196.166,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496822277.375,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496578802.75,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496659692.041,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497275373.166,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496593397.666,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496834440.333,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496687722.916,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497300534.375,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496735532.25,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496971071.416,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496928780.875,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497277745.458,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496687489.875,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497005917,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497195542.625,"data":["12-DateTime/app.js"]},{"name":"start_exercise","time":497034138.166,"data":"13-Factorial"},{"name":"open_files","time":497038881.25,"data":["13-Factorial/app.js"]},{"name":"open_files","time":497242953.125,"data":["13-Factorial/app.js"]},{"name":"open_files","time":497353098.75,"data":["13-Factorial/app.js"]},{"name":"open_files","time":496614234.083,"data":["13-Factorial/app.js"]},{"name":"open_files","time":496646530.083,"data":["13-Factorial/app.js"]},{"name":"open_files","time":497265569.833,"data":["13-Factorial/app.js"]},{"name":"open_files","time":496888703.416,"data":["13-Factorial/app.js"]},{"name":"open_files","time":496572819.875,"data":["13-Factorial/app.js"]},{"name":"start_exercise","time":496985863.791,"data":"14-Fibonacci"},{"name":"open_files","time":496994798.958,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497168661.833,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496585556.333,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497235593,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496526352.75,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497015137.041,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497303458.125,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497291245.625,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496842281.541,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497075523.125,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497458423.75,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496684285.625,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496953750.541,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497425075.541,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497503947.666,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497701473.375,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497392606.291,"data":["14-Fibonacci/app.js"]},{"name":"start_exercise","time":496789427.583,"data":"15-FizzBuzz"},{"name":"open_files","time":496795991.916,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497051971.583,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497445923.416,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":496819516.583,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497739446.041,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497415651.25,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497192936.958,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497542820.041,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497699419.958,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497553647.5,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497446685.25,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497491083.833,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":496951306.333,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497335187.75,"data":["15-FizzBuzz/app.js"]}] \ No newline at end of file diff --git a/06-LongestWord/app.js b/06-LongestWord/app.js index a439b9a..3e203df 100644 --- a/06-LongestWord/app.js +++ b/06-LongestWord/app.js @@ -1,2 +1 @@ // your code here - diff --git a/11-ConcatenateArrays/README.es.md b/11-ConcatenateArrays/README.es.md index 68e52f0..537b1a9 100644 --- a/11-ConcatenateArrays/README.es.md +++ b/11-ConcatenateArrays/README.es.md @@ -1,3 +1,5 @@ # `11` Concatenate Arrays -# Instrucciones 🗒 \ No newline at end of file +## Instrucciones 🗒 +1. Crea una funcion `concatenateIntArrays` que una dos `integer` arrays. +2. La funcion debe tomar `dos` arrays como argumento y retornar un `solo` array. diff --git a/11-ConcatenateArrays/README.md b/11-ConcatenateArrays/README.md index 8d0fed8..81cc387 100644 --- a/11-ConcatenateArrays/README.md +++ b/11-ConcatenateArrays/README.md @@ -1,3 +1,5 @@ # `11` Concatenate Arrays -# Instructions 🗒 \ No newline at end of file +## Instructions 🗒 +1. Create a function `concatenateIntArrays` to concatenate two `integer` arrays. +2. The function should take `two` arrays as arguments and return a `single` array. \ No newline at end of file diff --git a/11-ConcatenateArrays/app.js b/11-ConcatenateArrays/app.js index e69de29..851493a 100644 --- a/11-ConcatenateArrays/app.js +++ b/11-ConcatenateArrays/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/11-ConcatenateArrays/solution.hide.js b/11-ConcatenateArrays/solution.hide.js index e69de29..cd00a4f 100644 --- a/11-ConcatenateArrays/solution.hide.js +++ b/11-ConcatenateArrays/solution.hide.js @@ -0,0 +1,4 @@ +function concatenateIntArrays(array1, array2) { + const result = array1.concat(array2); + return result; +} \ No newline at end of file diff --git a/11-ConcatenateArrays/test.js b/11-ConcatenateArrays/test.js index e69de29..68f9bdb 100644 --- a/11-ConcatenateArrays/test.js +++ b/11-ConcatenateArrays/test.js @@ -0,0 +1,14 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test("concatenateIntArrays function must exist.", () => { + const concatenateIntArrays = app.__get__("concatenateIntArrays"); + expect(concatenateIntArrays).toBeTruthy(); +}); + +test("The final output should be a mix of the two arrays", () => { + const concatenateIntArrays = app.__get__("concatenateIntArrays"); + + expect(concatenateIntArrays([2, 3, 4, 6], [7, 12, 32, 64])).toEqual([2, 3, 4, 6, 7, 12, 32, 64]); + expect(concatenateIntArrays([1, 2, 3, 4, 5], [6, 7, 8, 9, 10])).toEqual([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +}); diff --git a/12-DateTime/README.es.md b/12-DateTime/README.es.md new file mode 100644 index 0000000..a64765a --- /dev/null +++ b/12-DateTime/README.es.md @@ -0,0 +1,6 @@ +# `12` Date and Time + +## Instrucciones 🗒 +1. Imprima la fecha y la hora actuales en el formato predeterminado. Asigne el resultado final a una variable `today`. +2. Imprima la fecha y hora actual en estilo localizado. Asigne el resultado final a unas variables `date` y `time`. +3. Imprima la fecha y hora actuales con un patrón. Asigne el resultado final a una variable `dateTime`. \ No newline at end of file diff --git a/12-DateTime/README.md b/12-DateTime/README.md new file mode 100644 index 0000000..32467cb --- /dev/null +++ b/12-DateTime/README.md @@ -0,0 +1,7 @@ +# `12` Date and Time + +## Instructions 🗒 +1. Print the current date and time in default format. Assign the final result to a `today` variable. +2. Print the current date and time in localised style. Assign the final result to a `date` and `time` variabales. +3. Print the current date and time with a pattern. Assign the final result to a `dateTime` variable. + diff --git a/12-DateTime/app.js b/12-DateTime/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/12-DateTime/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/12-DateTime/solution.hide.js b/12-DateTime/solution.hide.js new file mode 100644 index 0000000..c5eb422 --- /dev/null +++ b/12-DateTime/solution.hide.js @@ -0,0 +1,7 @@ +const today = new Date(); +const date = + today.getFullYear() + "-" + (today.getMonth() + 1) + "-" + today.getDate(); +const time = + today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds(); +const dateTime = date + " " + time; +console.log(dateTime); diff --git a/12-DateTime/test.js b/12-DateTime/test.js new file mode 100644 index 0000000..ceaa34c --- /dev/null +++ b/12-DateTime/test.js @@ -0,0 +1,24 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test("today variable must exist.", () => { + const today = app.__get__("today"); + expect(today).toBeTruthy(); +}); +test("date variable must exist.", () => { + const date = app.__get__("date"); + expect(date).toBeTruthy(); +}); +test("time variable must exist.", () => { + const time = app.__get__("time"); + expect(time).toBeTruthy(); +}); +test("dateTime variable must exist.", () => { + const dateTime = app.__get__("dateTime"); + expect(dateTime).toBeTruthy(); +}); +test("today must be a date object", () => { + const today = app.__get__("today"); + expect(typeof today).toBe("object"); +}); + diff --git a/13-Factorial/README.es.md b/13-Factorial/README.es.md new file mode 100644 index 0000000..a34d6bf --- /dev/null +++ b/13-Factorial/README.es.md @@ -0,0 +1,9 @@ +# `13` Factorial + +## Instrucciones 🗒 +1. Este desafío requiere que devuelvas el factorial de un número dado. +2. Un factorial de un número (`num`), es num multiplicado por (`num-1`) multiplicado por (`num-2`) y así sucesivamente hasta llegar al número 1. +3. Debe haber una funcion llamada `factorialize`. + +## Ejemplo 💡 +El factorial de `4` es `4 * 3 * 2 * 1 = 24`. Pasa de `1` a `num`, multiplicando cada número por el anterior, hasta llegar al número. \ No newline at end of file diff --git a/13-Factorial/README.md b/13-Factorial/README.md new file mode 100644 index 0000000..1dbe662 --- /dev/null +++ b/13-Factorial/README.md @@ -0,0 +1,9 @@ +# `13` Factorial + +## Instructions 🗒 +1. This challenge requires you to return the factorial of a given number. +2. A factorial of a number (`num`), is num multiplied by (`num-1`) multiplied by (`num-2`) and so forth until you reach the number 1. +3. There must be a `factorialize` function. + +## Example 💡 +The factorial of `4` is `4 * 3 * 2 * 1 = 24`. Loop from `1` to `num`, multiplying each number by the previous one, until you reach the number. \ No newline at end of file diff --git a/13-Factorial/app.js b/13-Factorial/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/13-Factorial/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/13-Factorial/solution.hide.js b/13-Factorial/solution.hide.js new file mode 100644 index 0000000..6c778d2 --- /dev/null +++ b/13-Factorial/solution.hide.js @@ -0,0 +1,12 @@ +function factorialize(num) { + // Step 1. Create a variable called result to store num + let result = num; + // If num = 0 OR num = 1, the factorial will return 1 + if (num === 0 || num === 1) return 1; + // Step 2. Create the WHILE loop + while (num > 1) { + num--; // decrements by 1 at each iteration + result *= num; + } + return result; +} diff --git a/13-Factorial/test.js b/13-Factorial/test.js new file mode 100644 index 0000000..027a5f6 --- /dev/null +++ b/13-Factorial/test.js @@ -0,0 +1,15 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test("factorialize function must exist.", () => { + const factorialize = app.__get__("factorialize"); + expect(factorialize).toBeTruthy(); +}); + +test("The factorials yield the correct answer.", () => { + const factorialize = app.__get__("factorialize"); + + expect(factorialize(4)).toBe(24); + expect(factorialize(5)).toBe(120); + expect(factorialize(13)).toBe(6227020800); +}); diff --git a/14-Fibonacci/README.es.md b/14-Fibonacci/README.es.md new file mode 100644 index 0000000..3ec2faa --- /dev/null +++ b/14-Fibonacci/README.es.md @@ -0,0 +1,5 @@ +# `14` Fibonacci +La secuencia de Fibonacci es una secuencia de números cuya suma es los dos números anteriores (por ejemplo, 0, 1, 1, 2, 3, etc.). + +## Instrucciones 🗒 +1. Usando `0` y `1` como valores iniciales, cree una función `fib` que imprima y retorna un array que contenga todos los números de Fibonacci hasta `10000`. \ No newline at end of file diff --git a/14-Fibonacci/README.md b/14-Fibonacci/README.md new file mode 100644 index 0000000..cb2a759 --- /dev/null +++ b/14-Fibonacci/README.md @@ -0,0 +1,5 @@ +# `14` Fibonacci +The Fibonacci Sequence is a sequence of numbers whose sum is the two preceding numbers (e.g. 0, 1, 1, 2, 3, etc). + +## Instructions 🗒 +1. Using `0` and `1` as the starting values, create a function `fib` that prints and returns an array containing all of the Fibonacci numbers up to `10000`. \ No newline at end of file diff --git a/14-Fibonacci/app.js b/14-Fibonacci/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/14-Fibonacci/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/14-Fibonacci/solution.hide.js b/14-Fibonacci/solution.hide.js new file mode 100644 index 0000000..4fce550 --- /dev/null +++ b/14-Fibonacci/solution.hide.js @@ -0,0 +1,13 @@ +function fib(n) { + const result = [0, 1]; + for (let i = 2; i < n; i++) { + if ((result[i - 2] + result[i - 1]) <= 10000){ + result.push(result[i - 2] + result[i - 1]); + }else{ + i = n; + } + } + console.log(result); + return result; +} +fib(22); \ No newline at end of file diff --git a/14-Fibonacci/test.js b/14-Fibonacci/test.js new file mode 100644 index 0000000..181f13e --- /dev/null +++ b/14-Fibonacci/test.js @@ -0,0 +1,18 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test("fib function must exist.", () => { + const fib = app.__get__("fib"); + expect(fib).toBeTruthy(); +}); +test("fib function must return all the fibonacci numbers less than or equal to 10,000", () => { + const fib = app.__get__("fib"); + expect(fib(22)).toEqual([ + 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, + 2584, 4181, 6765, + ]); +}); +test("fib function must return all the fibonacci numbers for any other given input | Do not hard code your answer!!", () => { + const fib = app.__get__("fib"); + expect(fib(14)).toEqual([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]); +}); diff --git a/15-FizzBuzz/README.es.md b/15-FizzBuzz/README.es.md new file mode 100644 index 0000000..70cdc2a --- /dev/null +++ b/15-FizzBuzz/README.es.md @@ -0,0 +1,7 @@ +# `15` FizzBuzz +Escriba un programa que imprima los números del 1 al 100. + +## Instrucciones 🗒 +1. Para múltiplos de tres, escriba `“Fizz”` en lugar del número. +2. Para los múltiplos de cinco, escribe `“Buzz”`. +3. Para números que son múltiplos de tres y cinco, escriba `“FizzBuzz”`. \ No newline at end of file diff --git a/15-FizzBuzz/README.md b/15-FizzBuzz/README.md new file mode 100644 index 0000000..b3a6709 --- /dev/null +++ b/15-FizzBuzz/README.md @@ -0,0 +1,7 @@ +# `15` FizzBuzz +Write a program that prints the numbers from 1 to 100. + +## Instructions 🗒 +1. For multiples of three print `“Fizz”` instead of the number. +2. For the multiples of five print `“Buzz”`. +3. For numbers which are multiples of both three and five print `“FizzBuzz”`. \ No newline at end of file diff --git a/15-FizzBuzz/app.js b/15-FizzBuzz/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/15-FizzBuzz/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/15-FizzBuzz/solution.hide.js b/15-FizzBuzz/solution.hide.js new file mode 100644 index 0000000..74a112b --- /dev/null +++ b/15-FizzBuzz/solution.hide.js @@ -0,0 +1,11 @@ +for (let i = 0; i < 101; i++) { + if (i % 3 === 0 && i % 5 === 0) { + console.log("FizzBuzz"); + } else if (i % 3 === 0) { + console.log("Fizz"); + } else if (i % 5 === 0) { + console.log("Buzz"); + } else { + console.log(i); + } +} \ No newline at end of file diff --git a/15-FizzBuzz/test.js b/15-FizzBuzz/test.js new file mode 100644 index 0000000..43c177c --- /dev/null +++ b/15-FizzBuzz/test.js @@ -0,0 +1,128 @@ +const fs = require("fs"); +const path = require("path"); + +jest.dontMock("fs"); +//here we are going to store and accumulate (concatenate) all the console log's from the exercise +let _buffer = ""; +let _log = console.log; + +// lets override the console.log function to mock it, +// but we are also going to save what supposed to be the ouput of the console inside _buffer +global.console.log = console.log = jest.fn((text) => (_buffer += text + "\n")); + +test("Your output should be printing, fizz, buzz, fizzbuzz, or just a number depending on whether that number is divisible by 3, 5, 3 & 5, or none", function () { + /* + Here is how to mock the alert function: + https://stackoverflow.com/questions/41885841/how-to-mock-the-javascript-window-object-using-jest + */ + + //then I import the index.js (which should have the alert() call inside) + const file = require("./app.js"); + + //and I expect the console.log to be already called just one time. + expect(console.log.mock.calls.length).toBe(101); + + //You can also compare the entire console buffer (if there have been several console.log calls on the exercise) + expect(_buffer).toBe( +`FizzBuzz +1 +2 +Fizz +4 +Buzz +Fizz +7 +8 +Fizz +Buzz +11 +Fizz +13 +14 +FizzBuzz +16 +17 +Fizz +19 +Buzz +Fizz +22 +23 +Fizz +Buzz +26 +Fizz +28 +29 +FizzBuzz +31 +32 +Fizz +34 +Buzz +Fizz +37 +38 +Fizz +Buzz +41 +Fizz +43 +44 +FizzBuzz +46 +47 +Fizz +49 +Buzz +Fizz +52 +53 +Fizz +Buzz +56 +Fizz +58 +59 +FizzBuzz +61 +62 +Fizz +64 +Buzz +Fizz +67 +68 +Fizz +Buzz +71 +Fizz +73 +74 +FizzBuzz +76 +77 +Fizz +79 +Buzz +Fizz +82 +83 +Fizz +Buzz +86 +Fizz +88 +89 +FizzBuzz +91 +92 +Fizz +94 +Buzz +Fizz +97 +98 +Fizz +Buzz\n`); +}); From 912374a23f6bed3acb5a9a18c113b54d84a7f344 Mon Sep 17 00:00:00 2001 From: umikami Date: Thu, 23 Jun 2022 16:39:46 -0400 Subject: [PATCH 16/28] added exercises 16-20 --- .learn/reports/16-CapitaliseLetters.json | 25 ++++++++++++++ .learn/reports/17-MultiplyAndSkip.json | 17 +++++++++ .learn/reports/18-NameChange.json | 33 ++++++++++++++++++ .learn/reports/19-Palindrome.json | 21 ++++++++++++ .learn/reports/20-RemoveCharacters.json | 21 ++++++++++++ .learn/resets/16-CapitaliseLetters/app.js | 0 .learn/resets/17-MultiplyAndSkip/app.js | 0 .learn/resets/18-NameChange/app.js | 0 .learn/resets/19-Palindrome/app.js | 0 .learn/resets/20-RemoveCharacters/app.js | 0 .learn/vscode_queue.json | 2 +- 16-CapitaliseLetters/README.es.md | 5 +++ 16-CapitaliseLetters/README.md | 5 +++ 16-CapitaliseLetters/app.js | 1 + 16-CapitaliseLetters/solution.hide.js | 10 ++++++ 16-CapitaliseLetters/test.js | 39 +++++++++++++++++++++ 17-MultiplyAndSkip/README.es.md | 4 +++ 17-MultiplyAndSkip/README.md | 4 +++ 17-MultiplyAndSkip/app.js | 1 + 17-MultiplyAndSkip/solution.hide.js | 7 ++++ 17-MultiplyAndSkip/test.js | 42 +++++++++++++++++++++++ 18-NameChange/README.es.md | 4 +++ 18-NameChange/README.md | 4 +++ 18-NameChange/app.js | 1 + 18-NameChange/solution.hide.js | 20 +++++++++++ 19-Palindrome/README.es.md | 6 ++++ 19-Palindrome/README.md | 6 ++++ 19-Palindrome/app.js | 1 + 19-Palindrome/solution.hide.js | 8 +++++ 19-Palindrome/test.js | 16 +++++++++ 20-RemoveCharacters/README.es.md | 5 +++ 20-RemoveCharacters/README.md | 5 +++ 20-RemoveCharacters/app.js | 1 + 20-RemoveCharacters/solution.hide.js | 5 +++ 20-RemoveCharacters/test.js | 20 +++++++++++ 35 files changed, 338 insertions(+), 1 deletion(-) create mode 100644 .learn/reports/16-CapitaliseLetters.json create mode 100644 .learn/reports/17-MultiplyAndSkip.json create mode 100644 .learn/reports/18-NameChange.json create mode 100644 .learn/reports/19-Palindrome.json create mode 100644 .learn/reports/20-RemoveCharacters.json create mode 100644 .learn/resets/16-CapitaliseLetters/app.js create mode 100644 .learn/resets/17-MultiplyAndSkip/app.js create mode 100644 .learn/resets/18-NameChange/app.js create mode 100644 .learn/resets/19-Palindrome/app.js create mode 100644 .learn/resets/20-RemoveCharacters/app.js create mode 100644 16-CapitaliseLetters/README.es.md create mode 100644 16-CapitaliseLetters/README.md create mode 100644 16-CapitaliseLetters/app.js create mode 100644 16-CapitaliseLetters/solution.hide.js create mode 100644 16-CapitaliseLetters/test.js create mode 100644 17-MultiplyAndSkip/README.es.md create mode 100644 17-MultiplyAndSkip/README.md create mode 100644 17-MultiplyAndSkip/app.js create mode 100644 17-MultiplyAndSkip/solution.hide.js create mode 100644 17-MultiplyAndSkip/test.js create mode 100644 18-NameChange/README.es.md create mode 100644 18-NameChange/README.md create mode 100644 18-NameChange/app.js create mode 100644 18-NameChange/solution.hide.js create mode 100644 19-Palindrome/README.es.md create mode 100644 19-Palindrome/README.md create mode 100644 19-Palindrome/app.js create mode 100644 19-Palindrome/solution.hide.js create mode 100644 19-Palindrome/test.js create mode 100644 20-RemoveCharacters/README.es.md create mode 100644 20-RemoveCharacters/README.md create mode 100644 20-RemoveCharacters/app.js create mode 100644 20-RemoveCharacters/solution.hide.js create mode 100644 20-RemoveCharacters/test.js diff --git a/.learn/reports/16-CapitaliseLetters.json b/.learn/reports/16-CapitaliseLetters.json new file mode 100644 index 0000000..1dfaa8d --- /dev/null +++ b/.learn/reports/16-CapitaliseLetters.json @@ -0,0 +1,25 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 3, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "You should be printing your result", + "status": "passed" + }, + { + "title": "caps function must exist", + "status": "passed" + }, + { + "title": "caps function must return strings in the correct format for any input", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/17-MultiplyAndSkip.json b/.learn/reports/17-MultiplyAndSkip.json new file mode 100644 index 0000000..4cbbd32 --- /dev/null +++ b/.learn/reports/17-MultiplyAndSkip.json @@ -0,0 +1,17 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 1, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "Your output should be printing, fizz, buzz, fizzbuzz, or just a number depending on whether that number is divisible by 3, 5, 3 & 5, or none", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/18-NameChange.json b/.learn/reports/18-NameChange.json new file mode 100644 index 0000000..bc0477d --- /dev/null +++ b/.learn/reports/18-NameChange.json @@ -0,0 +1,33 @@ +{ + "success": false, + "numFailedTestSuites": 1, + "numFailedTests": 4, + "numPassedTests": 1, + "testResults": [ + { + "message": "\u001b[1m\u001b[31m \u001b[1m● \u001b[1mchangeName method must exist\u001b[39m\u001b[22m\n\n ReferenceError: changeName is not defined\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat eval (eval at __get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16), :1:1)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object.__get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object. (\u001b[2m\u001b[0m\u001b[36m18-NameChange/test.js\u001b[39m\u001b[0m\u001b[2m:9:26)\u001b[2m\u001b[22m\n\n\u001b[1m\u001b[31m \u001b[1m● \u001b[1mfirstName property must exist in Person object\u001b[39m\u001b[22m\n\n ReferenceError: firstName is not defined\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat eval (eval at __get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16), :1:1)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object.__get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object. (\u001b[2m\u001b[0m\u001b[36m18-NameChange/test.js\u001b[39m\u001b[0m\u001b[2m:13:25)\u001b[2m\u001b[22m\n\n\u001b[1m\u001b[31m \u001b[1m● \u001b[1mlastName property must exist in Person object\u001b[39m\u001b[22m\n\n ReferenceError: lastName is not defined\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat eval (eval at __get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16), :1:1)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object.__get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object. (\u001b[2m\u001b[0m\u001b[36m18-NameChange/test.js\u001b[39m\u001b[0m\u001b[2m:17:24)\u001b[2m\u001b[22m\n\n\u001b[1m\u001b[31m \u001b[1m● \u001b[1mI should be able to change my last name.\u001b[39m\u001b[22m\n\n \u001b[2mexpect(\u001b[22m\u001b[31mreceived\u001b[39m\u001b[2m).\u001b[22mtoBe\u001b[2m(\u001b[22m\u001b[32mexpected\u001b[39m\u001b[2m) // Object.is equality\u001b[22m\n\n Expected: \u001b[32m\"Smith\"\u001b[39m\n Received: \u001b[31m\"Max\"\u001b[39m\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 25 |\u001b[39m personTest\u001b[33m.\u001b[39mchangeName(\u001b[32m\"Smith\"\u001b[39m)\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 26 |\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m\u001b[31m\u001b[1m>\u001b[2m\u001b[39m\u001b[90m 27 |\u001b[39m expect(personTest\u001b[33m.\u001b[39mfirstName)\u001b[33m.\u001b[39mtoBe(\u001b[32m\"Smith\"\u001b[39m)\u001b[33m;\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m |\u001b[39m \u001b[31m\u001b[1m^\u001b[2m\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 28 |\u001b[39m })\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 29 |\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object. (\u001b[2m\u001b[0m\u001b[36m18-NameChange/test.js\u001b[39m\u001b[0m\u001b[2m:27:34)\u001b[2m\u001b[22m\n" + } + ], + "failed": [ + { + "title": "Person object function must exist", + "status": "passed" + }, + { + "title": "changeName method must exist", + "status": "failed" + }, + { + "title": "firstName property must exist in Person object", + "status": "failed" + }, + { + "title": "lastName property must exist in Person object", + "status": "failed" + }, + { + "title": "I should be able to change my last name.", + "status": "failed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/19-Palindrome.json b/.learn/reports/19-Palindrome.json new file mode 100644 index 0000000..18ec701 --- /dev/null +++ b/.learn/reports/19-Palindrome.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "palindrome function must exist", + "status": "passed" + }, + { + "title": "The function should return if the string is a palidrone or not (true or false)", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/20-RemoveCharacters.json b/.learn/reports/20-RemoveCharacters.json new file mode 100644 index 0000000..aa41479 --- /dev/null +++ b/.learn/reports/20-RemoveCharacters.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "removeChars function must exist", + "status": "passed" + }, + { + "title": "The function should return a string with the first and last characters remvoed", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/resets/16-CapitaliseLetters/app.js b/.learn/resets/16-CapitaliseLetters/app.js new file mode 100644 index 0000000..e69de29 diff --git a/.learn/resets/17-MultiplyAndSkip/app.js b/.learn/resets/17-MultiplyAndSkip/app.js new file mode 100644 index 0000000..e69de29 diff --git a/.learn/resets/18-NameChange/app.js b/.learn/resets/18-NameChange/app.js new file mode 100644 index 0000000..e69de29 diff --git a/.learn/resets/19-Palindrome/app.js b/.learn/resets/19-Palindrome/app.js new file mode 100644 index 0000000..e69de29 diff --git a/.learn/resets/20-RemoveCharacters/app.js b/.learn/resets/20-RemoveCharacters/app.js new file mode 100644 index 0000000..e69de29 diff --git a/.learn/vscode_queue.json b/.learn/vscode_queue.json index d5fefc6..b3c37ca 100644 --- a/.learn/vscode_queue.json +++ b/.learn/vscode_queue.json @@ -1 +1 @@ -[{"name":"initializing","time":495613819.583},{"name":"reset","time":495613834.5},{"name":"configuration_loaded","time":495618771.541},{"name":"start_exercise","time":495027282.416,"data":"02-CompareStrings"},{"name":"open_files","time":495033373.625,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":495215059.833,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":495348547.041,"data":"03-DivisibleBy5"},{"name":"open_files","time":495354444.458,"data":["03-DivisibleBy5/app.js"]},{"name":"start_exercise","time":495506380,"data":"04-VowelCount"},{"name":"open_files","time":495519117.791,"data":["04-VowelCount/app.js"]},{"name":"start_exercise","time":495639564.875,"data":"05-AreaOfTriangle"},{"name":"open_files","time":495645479.416,"data":["05-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":494921632.166,"data":"06-LongestWord"},{"name":"open_files","time":494924919.833,"data":["06-LongestWord/app.js"]},{"name":"start_exercise","time":495064944.083,"data":"07-MissingAngle"},{"name":"open_files","time":495072722.541,"data":["07-MissingAngle/app.js"]},{"name":"start_exercise","time":495222269.833,"data":"08-NumberLimit"},{"name":"open_files","time":495226883.166,"data":["08-NumberLimit/app.js"]},{"name":"start_exercise","time":495378989.583,"data":"09-FormatPhoneNumber"},{"name":"open_files","time":495382504.625,"data":["09-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":495535955.833,"data":"10-ShareCake"},{"name":"open_files","time":495542760.166,"data":["10-ShareCake/app.js"]},{"name":"start_exercise","time":495689009.791,"data":"11-ConcatenateArrays"},{"name":"open_files","time":495692543.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"start_exercise","time":495106049.208,"data":"12-DateTime"},{"name":"open_files","time":495108888.416,"data":["12-DateTime/app.js"]},{"name":"start_exercise","time":495115797.833,"data":"11-ConcatenateArrays"},{"name":"open_files","time":495122087.041,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495282523.25,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495238312.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495688165.833,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495831017.291,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495260934.666,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495048502.958,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495634289.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495105418.541,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495759120.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495277164.291,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495513588.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495762854.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495510926.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495192628.791,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495891386.791,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495815507.625,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495684714.375,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495309414.333,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495529844.166,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495967328.625,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495892258.291,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495555856,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495211507.125,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495399197.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495997300.458,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":496084251.333,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495632748.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495913104.375,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495946748.208,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495844831.25,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495183448.25,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495666090.625,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495879898.625,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495503876.375,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495772695.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495369394.666,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495263226.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495959457.708,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495293495.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495481249.333,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495414308.083,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495892806.916,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495240475.708,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495550815.875,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":496023222.291,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495469778.833,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495534130.708,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495661384.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495596615.25,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495697821,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495516613.666,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495692708.166,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":496014158.541,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495882897.333,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495644837.416,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495459047.666,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":495850497.5,"data":["11-ConcatenateArrays/app.js"]},{"name":"open_files","time":496905354.708,"data":["11-ConcatenateArrays/app.js"]},{"name":"start_exercise","time":496563388.25,"data":"12-DateTime"},{"name":"open_files","time":496576072.583,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496934196.166,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496822277.375,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496578802.75,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496659692.041,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497275373.166,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496593397.666,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496834440.333,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496687722.916,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497300534.375,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496735532.25,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496971071.416,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496928780.875,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497277745.458,"data":["12-DateTime/app.js"]},{"name":"open_files","time":496687489.875,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497005917,"data":["12-DateTime/app.js"]},{"name":"open_files","time":497195542.625,"data":["12-DateTime/app.js"]},{"name":"start_exercise","time":497034138.166,"data":"13-Factorial"},{"name":"open_files","time":497038881.25,"data":["13-Factorial/app.js"]},{"name":"open_files","time":497242953.125,"data":["13-Factorial/app.js"]},{"name":"open_files","time":497353098.75,"data":["13-Factorial/app.js"]},{"name":"open_files","time":496614234.083,"data":["13-Factorial/app.js"]},{"name":"open_files","time":496646530.083,"data":["13-Factorial/app.js"]},{"name":"open_files","time":497265569.833,"data":["13-Factorial/app.js"]},{"name":"open_files","time":496888703.416,"data":["13-Factorial/app.js"]},{"name":"open_files","time":496572819.875,"data":["13-Factorial/app.js"]},{"name":"start_exercise","time":496985863.791,"data":"14-Fibonacci"},{"name":"open_files","time":496994798.958,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497168661.833,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496585556.333,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497235593,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496526352.75,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497015137.041,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497303458.125,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497291245.625,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496842281.541,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497075523.125,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497458423.75,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496684285.625,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":496953750.541,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497425075.541,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497503947.666,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497701473.375,"data":["14-Fibonacci/app.js"]},{"name":"open_files","time":497392606.291,"data":["14-Fibonacci/app.js"]},{"name":"start_exercise","time":496789427.583,"data":"15-FizzBuzz"},{"name":"open_files","time":496795991.916,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497051971.583,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497445923.416,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":496819516.583,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497739446.041,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497415651.25,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497192936.958,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497542820.041,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497699419.958,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497553647.5,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497446685.25,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497491083.833,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":496951306.333,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":497335187.75,"data":["15-FizzBuzz/app.js"]}] \ No newline at end of file +[{"name":"initializing","time":500892235.625},{"name":"reset","time":500892252.875},{"name":"configuration_loaded","time":500897251.041},{"name":"open_files","time":500729997,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":500929551.541,"data":["15-FizzBuzz/app.js"]},{"name":"start_exercise","time":501351964.458,"data":"16-CapitaliseLetters"},{"name":"open_files","time":501357341.916,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501549047.625,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500921589.541,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500717524.375,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501205730.541,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500666054.166,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500939383.875,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500988679.083,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500834127.708,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500762100.916,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501340377.791,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501078938.25,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501460777.041,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501175581.041,"data":["16-CapitaliseLetters/app.js"]},{"name":"start_exercise","time":501643093.833,"data":"17-MultiplyAndSkip"},{"name":"open_files","time":501649015.833,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500878883.5,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501400733.375,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500985226.416,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501672981.625,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500722237.333,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501120048.708,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501640697.125,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500880205.208,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500989922.541,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501508953.375,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501551817.5,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501123446.125,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501278047.541,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501044040.208,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501924033.25,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501115199,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501101298.25,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501089286.708,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501602475.291,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501350358.958,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501258650.833,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501366150.583,"data":["17-MultiplyAndSkip/app.js"]},{"name":"start_exercise","time":501444732.416,"data":"18-NameChange"},{"name":"open_files","time":501450687.541,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501685022.75,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501736526.166,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502081612.291,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501591754.833,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501534732.666,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501813778,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501441392.5,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502124360.125,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501721351.791,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501428256.958,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502190211.875,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502214464.916,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502015757.333,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502235618.083,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501734886.708,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502174089.708,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501598825.041,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501736396.416,"data":["18-NameChange/app.js"]},{"name":"start_exercise","time":502252975.875,"data":"19-Palindrome"},{"name":"open_files","time":502259305.708,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501537386.875,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501844115.291,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501650094.625,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501720039.708,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502211911.875,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502355018.375,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501495662.833,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501846967.333,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501789317.041,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502329879.333,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502412714.833,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502187465.833,"data":["19-Palindrome/app.js"]},{"name":"start_exercise","time":501628358.166,"data":"20-RemoveCharacters"},{"name":"open_files","time":501634904.291,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501851912,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":502143265.375,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":502393028.75,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":502327855.625,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501990527.166,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501684958.625,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501596280.791,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501965760.75,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501985139.458,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501995576.833,"data":["20-RemoveCharacters/app.js"]}] \ No newline at end of file diff --git a/16-CapitaliseLetters/README.es.md b/16-CapitaliseLetters/README.es.md new file mode 100644 index 0000000..e7ca88a --- /dev/null +++ b/16-CapitaliseLetters/README.es.md @@ -0,0 +1,5 @@ +# `16` Capitalise Letters + +## Instrucciones 🗒 +1. Cree una función `caps` que convierta el primer carácter de cada palabra en mayúsculas. +2. Imprima y retorne la palabra o frase recién formateado. \ No newline at end of file diff --git a/16-CapitaliseLetters/README.md b/16-CapitaliseLetters/README.md new file mode 100644 index 0000000..314206a --- /dev/null +++ b/16-CapitaliseLetters/README.md @@ -0,0 +1,5 @@ +# `16` Capitalise Letters + +## Instructions 🗒 +1. Create a function `caps` that converts the first character of each word to uppercase. +2. Print and return the newly formatted string. \ No newline at end of file diff --git a/16-CapitaliseLetters/app.js b/16-CapitaliseLetters/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/16-CapitaliseLetters/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/16-CapitaliseLetters/solution.hide.js b/16-CapitaliseLetters/solution.hide.js new file mode 100644 index 0000000..6e21d70 --- /dev/null +++ b/16-CapitaliseLetters/solution.hide.js @@ -0,0 +1,10 @@ +const caps = (str) => { + str = str + .toLowerCase() + .split(" ") + .map((s) => s.charAt(0).toUpperCase() + s.substring(1)) + .join(" "); + console.log(str); + return str; +}; +caps("javascript is a fantastic language."); diff --git a/16-CapitaliseLetters/test.js b/16-CapitaliseLetters/test.js new file mode 100644 index 0000000..57d79b9 --- /dev/null +++ b/16-CapitaliseLetters/test.js @@ -0,0 +1,39 @@ +const fs = require("fs"); +const path = require("path"); + +jest.dontMock("fs"); +//here we are going to store and accumulate (concatenate) all the console log's from the exercise +let _buffer = ""; +let _log = console.log; + +// lets override the console.log function to mock it, +// but we are also going to save what supposed to be the ouput of the console inside _buffer +global.console.log = console.log = jest.fn((text) => (_buffer += text + "\n")); + +test("You should be printing your result", function () { + /* + Here is how to mock the alert function: + https://stackoverflow.com/questions/41885841/how-to-mock-the-javascript-window-object-using-jest + */ + + //then I import the index.js (which should have the alert() call inside) + const file = require("./app.js"); + + //and I expect the console.log to be already called just one time. + expect(console.log.mock.calls.length).toBe(1); +}); + + +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test("caps function must exist", ()=>{ + const caps = app.__get__("caps"); + expect(caps).toBeTruthy(); +}) +test("caps function must return strings in the correct format for any input", ()=>{ + const caps = app.__get__("caps"); + expect(caps("the world of gamble")).toBe("The World Of Gamble") + expect(caps("My little Angel")).toBe("My Little Angel") + expect(caps("jose Alberto hernandez cortez de borbon")).toBe("Jose Alberto Hernandez Cortez De Borbon") +}) \ No newline at end of file diff --git a/17-MultiplyAndSkip/README.es.md b/17-MultiplyAndSkip/README.es.md new file mode 100644 index 0000000..4561dca --- /dev/null +++ b/17-MultiplyAndSkip/README.es.md @@ -0,0 +1,4 @@ +# `17` Multiply and Skip + +## Instrucciones 🗒 +1. Itera del 1 al 100 inclusivo y imprime los múltiplos de `5` mientras **saltas** los múltiplos de `3`. \ No newline at end of file diff --git a/17-MultiplyAndSkip/README.md b/17-MultiplyAndSkip/README.md new file mode 100644 index 0000000..7cd1b7e --- /dev/null +++ b/17-MultiplyAndSkip/README.md @@ -0,0 +1,4 @@ +# `17` Multiply and Skip + +## Instructions 🗒 +1. Iterate from 1 to 100 inclusive and print the multiples of `5` whilst **skipping** the multiples of `3`. \ No newline at end of file diff --git a/17-MultiplyAndSkip/app.js b/17-MultiplyAndSkip/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/17-MultiplyAndSkip/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/17-MultiplyAndSkip/solution.hide.js b/17-MultiplyAndSkip/solution.hide.js new file mode 100644 index 0000000..b7a38a8 --- /dev/null +++ b/17-MultiplyAndSkip/solution.hide.js @@ -0,0 +1,7 @@ +for (let i = 1; i <= 100; i++) { + if (i % 3 === 0) { + continue; + } else if (i % 5 === 0) { + console.log(i); + } +} \ No newline at end of file diff --git a/17-MultiplyAndSkip/test.js b/17-MultiplyAndSkip/test.js new file mode 100644 index 0000000..dba5022 --- /dev/null +++ b/17-MultiplyAndSkip/test.js @@ -0,0 +1,42 @@ +const fs = require("fs"); +const path = require("path"); + +jest.dontMock("fs"); +//here we are going to store and accumulate (concatenate) all the console log's from the exercise +let _buffer = ""; +let _log = console.log; + +// lets override the console.log function to mock it, +// but we are also going to save what supposed to be the ouput of the console inside _buffer +global.console.log = console.log = jest.fn((text) => (_buffer += text + "\n")); + +test("Your output should be printing, fizz, buzz, fizzbuzz, or just a number depending on whether that number is divisible by 3, 5, 3 & 5, or none", function () { + /* + Here is how to mock the alert function: + https://stackoverflow.com/questions/41885841/how-to-mock-the-javascript-window-object-using-jest + */ + + //then I import the index.js (which should have the alert() call inside) + const file = require("./app.js"); + + //and I expect the console.log to be already called just one time. + expect(console.log.mock.calls.length).toBe(14); + + //You can also compare the entire console buffer (if there have been several console.log calls on the exercise) + expect(_buffer).toBe( +`5 +10 +20 +25 +35 +40 +50 +55 +65 +70 +80 +85 +95 +100\n` + ); +}); diff --git a/18-NameChange/README.es.md b/18-NameChange/README.es.md new file mode 100644 index 0000000..b7d8fb3 --- /dev/null +++ b/18-NameChange/README.es.md @@ -0,0 +1,4 @@ +# `18` Name Change + +## Instrucciones 🗒 +1. Cambia tu apellido usando una función constructora `Person`, la función `changeName` y una instancia de `objeto`. \ No newline at end of file diff --git a/18-NameChange/README.md b/18-NameChange/README.md new file mode 100644 index 0000000..13b9891 --- /dev/null +++ b/18-NameChange/README.md @@ -0,0 +1,4 @@ +# `18` Name Change + +## Instructions 🗒 +1. Change your surname using a constructor function `Person`, the `changeName` function and an `object` instance. \ No newline at end of file diff --git a/18-NameChange/app.js b/18-NameChange/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/18-NameChange/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/18-NameChange/solution.hide.js b/18-NameChange/solution.hide.js new file mode 100644 index 0000000..646d630 --- /dev/null +++ b/18-NameChange/solution.hide.js @@ -0,0 +1,20 @@ +// your code here +function Person(firstName, lastName) { + this.firstName = firstName; + this.lastName = lastName; + // change name function + this.changeName = function (name) { + this.lastName = name; + }; +} + +// Object instance +const person1 = new Person("Sharon", "Goldsworth"); + +// changeName() changes last name +person1.changeName("Smith"); + +// Print new name +console.log( + `Person one is now called ${person1.firstName} ${person1.lastName}.` +); diff --git a/19-Palindrome/README.es.md b/19-Palindrome/README.es.md new file mode 100644 index 0000000..7565226 --- /dev/null +++ b/19-Palindrome/README.es.md @@ -0,0 +1,6 @@ +# `19` Palindrome +Un palíndromo es una palabra, número u otra secuencia de caracteres que se lee igual hacia atrás que hacia adelante, como "Ana" o "Otto". También puede crear un palíndromo int. + +## Instrucciones 🗒 +1. Dada una cadena de texto, devuelva `true` o `false` indicando si el texto es un palíndromo o no. +2. Debe haber una funcion llamada `palindrome`. \ No newline at end of file diff --git a/19-Palindrome/README.md b/19-Palindrome/README.md new file mode 100644 index 0000000..cebd325 --- /dev/null +++ b/19-Palindrome/README.md @@ -0,0 +1,6 @@ +# `19` Palindrome +A palindrome is a word, number, or other sequence of characters which reads the same backward as forward, such as "madam" or "racecar". You can also create an int palindrome. + +## Instructions 🗒 +1. Given a string of text, return `true` or `false` indicating whether or not the text is a palindrome. +2. There should be a function called `palindrome`. \ No newline at end of file diff --git a/19-Palindrome/app.js b/19-Palindrome/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/19-Palindrome/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/19-Palindrome/solution.hide.js b/19-Palindrome/solution.hide.js new file mode 100644 index 0000000..3cb43d1 --- /dev/null +++ b/19-Palindrome/solution.hide.js @@ -0,0 +1,8 @@ +const palindrome = (str) => { + // turn string to lowercase + str = str.toLowerCase(); + // split, reverse & join string and print + console.log(str === str.split("").reverse().join("")); + return(str === str.split("").reverse().join("")); +}; +palindrome("anna"); diff --git a/19-Palindrome/test.js b/19-Palindrome/test.js new file mode 100644 index 0000000..a4af24d --- /dev/null +++ b/19-Palindrome/test.js @@ -0,0 +1,16 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test("palindrome function must exist", () => { + const palindrome = app.__get__("palindrome"); + expect(palindrome).toBeTruthy(); +}); + +test("The function should return if the string is a palidrone or not (true or false)", () => { + const palindrome = app.__get__("palindrome"); + expect(palindrome("anna")).toBe(true); + expect(palindrome("otto")).toBe(true); + expect(palindrome("12321")).toBe(true); + expect(palindrome("madman")).toBe(false); + expect(palindrome("ily")).toBe(false); +}) \ No newline at end of file diff --git a/20-RemoveCharacters/README.es.md b/20-RemoveCharacters/README.es.md new file mode 100644 index 0000000..f66ceb5 --- /dev/null +++ b/20-RemoveCharacters/README.es.md @@ -0,0 +1,5 @@ +# `20` Remove Characters + +## Instrucciones 🗒 +1. Cree una funcion `removeChars` que elimine el primer y el último carácter de un string. +2. Retorne el string modificado. \ No newline at end of file diff --git a/20-RemoveCharacters/README.md b/20-RemoveCharacters/README.md new file mode 100644 index 0000000..bd7e555 --- /dev/null +++ b/20-RemoveCharacters/README.md @@ -0,0 +1,5 @@ +# `20` Remove Characters + +## Instructions 🗒 +1. Create a function `removeChars` that removes the first and last characters from a string. +2. Return the modified string. \ No newline at end of file diff --git a/20-RemoveCharacters/app.js b/20-RemoveCharacters/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/20-RemoveCharacters/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/20-RemoveCharacters/solution.hide.js b/20-RemoveCharacters/solution.hide.js new file mode 100644 index 0000000..ef602eb --- /dev/null +++ b/20-RemoveCharacters/solution.hide.js @@ -0,0 +1,5 @@ +function removeChars(str) { + const result = str.substring(1, str.length - 1); + return result; +} +removeChars("The first and last characters are removed"); diff --git a/20-RemoveCharacters/test.js b/20-RemoveCharacters/test.js new file mode 100644 index 0000000..19cdbe2 --- /dev/null +++ b/20-RemoveCharacters/test.js @@ -0,0 +1,20 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test("removeChars function must exist", () => { + const removeChars = app.__get__("removeChars"); + expect(removeChars).toBeTruthy(); +}); + +test("The function should return a string with the first and last characters remvoed", () => { + const removeChars = app.__get__("removeChars"); + expect(removeChars("the world of gamble")).toBe("he world of gambl"); + expect(removeChars("hello world")).toBe("ello worl"); + expect( + removeChars( + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum" + ) + ).toBe( + "orem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laboru" + ); +}); \ No newline at end of file From 3fc8081d38e23479d44aa59adbe695222c642182 Mon Sep 17 00:00:00 2001 From: umikami Date: Thu, 23 Jun 2022 16:40:39 -0400 Subject: [PATCH 17/28] added test 18 - review please --- 18-NameChange/test.js | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 18-NameChange/test.js diff --git a/18-NameChange/test.js b/18-NameChange/test.js new file mode 100644 index 0000000..681105f --- /dev/null +++ b/18-NameChange/test.js @@ -0,0 +1,28 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); + +test("Person object function must exist", () => { + const Person = app.__get__("Person"); + expect(Person).toBeTruthy(); +}); +test("changeName method must exist", () => { + const changeName = app.__get__("changeName"); + expect(changeName).toBeTruthy(); +}); +test("firstName property must exist in Person object", () => { + const firstName = app.__get__("firstName"); + expect(firstName).toBeTruthy(); +}); +test("lastName property must exist in Person object", () => { + const lastName = app.__get__("lastName"); + expect(lastName).toBeTruthy(); +}); + +test("I should be able to change my last name.", () => { + const Person = app.__get__("Person") + const personTest = new Person("Max", "Gonz") + + personTest.changeName("Smith") + + expect(personTest.firstName).toBe("Smith"); +}) From b8d2d33be27c8b8b8a5834c85bf26d2c7be6c7fc Mon Sep 17 00:00:00 2001 From: umikami Date: Sun, 26 Jun 2022 20:50:45 -0400 Subject: [PATCH 18/28] Exercises reorganized and fixes applied --- .learn/reports/08-Fibonacci.json | 21 ++++++++++++++ .learn/reports/12-NameChange.json | 29 +++++++++++++++++++ .learn/reports/18-NameChange.json | 18 +++++------- .../resets/03-ConcatenateArrays}/app.js | 0 .../resets/05-DateTime}/app.js | 0 .../resets/06-DivisibleBy5}/app.js | 0 .../resets/07-Factorial}/app.js | 0 .learn/resets/08-Fibonacci/app.js | 14 +++++++++ .../resets/09-FizzBuzz}/app.js | 0 .../resets/10-CapitaliseLetters}/app.js | 0 .../resets/11-MultiplyAndSkip}/app.js | 0 .../resets/12-NameChange/app.js | 0 .../resets/13-Palindrome}/app.js | 0 .../resets/14-RemoveCharacters}/app.js | 0 .../resets/15-ShareCake}/app.js | 0 .../resets/16-FormatPhoneNumber}/app.js | 0 .../resets/17-AreaOfTriangle}/app.js | 0 .../resets/18-LongestWord}/app.js | 0 .../resets/19-MissingAngle}/app.js | 0 .../resets/20-NumberLimit}/app.js | 0 .learn/vscode_queue.json | 2 +- 02-CompareStrings/app.js | 2 +- .../README.es.md | 2 +- .../README.md | 2 +- .../app.js | 0 .../solution.hide.js | 0 .../test.js | 0 04-VowelCount/app.js | 2 +- {12-DateTime => 05-DateTime}/README.es.md | 2 +- {12-DateTime => 05-DateTime}/README.md | 2 +- {20-RemoveCharacters => 05-DateTime}/app.js | 0 {12-DateTime => 05-DateTime}/solution.hide.js | 0 {12-DateTime => 05-DateTime}/test.js | 0 .../README.es.md | 2 +- .../README.md | 2 +- 06-DivisibleBy5/app.js | 1 + .../solution.hide.js | 0 {03-DivisibleBy5 => 06-DivisibleBy5}/test.js | 0 {13-Factorial => 07-Factorial}/README.es.md | 2 +- {13-Factorial => 07-Factorial}/README.md | 2 +- 07-Factorial/app.js | 1 + .../solution.hide.js | 0 {13-Factorial => 07-Factorial}/test.js | 0 {14-Fibonacci => 08-Fibonacci}/README.es.md | 4 +-- {14-Fibonacci => 08-Fibonacci}/README.md | 4 +-- 08-Fibonacci/app.js | 1 + 08-Fibonacci/solution.hide.js | 10 +++++++ {14-Fibonacci => 08-Fibonacci}/test.js | 11 ++++--- {15-FizzBuzz => 09-FizzBuzz}/README.es.md | 2 +- {15-FizzBuzz => 09-FizzBuzz}/README.md | 2 +- 09-FizzBuzz/app.js | 1 + {15-FizzBuzz => 09-FizzBuzz}/solution.hide.js | 0 {15-FizzBuzz => 09-FizzBuzz}/test.js | 0 .../README.es.md | 2 +- .../README.md | 2 +- 10-CapitaliseLetters/app.js | 1 + .../solution.hide.js | 0 .../test.js | 0 .../README.es.md | 2 +- .../README.md | 2 +- 11-MultiplyAndSkip/app.js | 1 + .../solution.hide.js | 0 .../test.js | 0 {18-NameChange => 12-NameChange}/README.es.md | 2 +- {18-NameChange => 12-NameChange}/README.md | 2 +- 12-NameChange/app.js | 1 + 12-NameChange/solution.hide.js | 20 +++++++++++++ 12-NameChange/test.js | 20 +++++++++++++ {19-Palindrome => 13-Palindrome}/README.es.md | 2 +- {19-Palindrome => 13-Palindrome}/README.md | 2 +- 13-Palindrome/app.js | 1 + .../solution.hide.js | 0 {19-Palindrome => 13-Palindrome}/test.js | 0 14-Fibonacci/solution.hide.js | 13 --------- .../README.es.md | 2 +- .../README.md | 2 +- 14-RemoveCharacters/app.js | 1 + .../solution.hide.js | 0 .../test.js | 0 {10-ShareCake => 15-ShareCake}/README.es.md | 2 +- {10-ShareCake => 15-ShareCake}/README.md | 2 +- 15-ShareCake/app.js | 1 + .../solution.hide.js | 0 {10-ShareCake => 15-ShareCake}/test.js | 0 .../README.es.md | 2 +- .../README.md | 2 +- 16-FormatPhoneNumber/app.js | 1 + .../solution.hide.js | 0 .../test.js | 0 .../README.es.md | 2 +- .../README.md | 2 +- 17-AreaOfTriangle/app.js | 1 + .../solution.hide.js | 0 .../test.js | 0 .../README.es.md | 2 +- {06-LongestWord => 18-LongestWord}/README.md | 2 +- 18-LongestWord/app.js | 1 + .../solution.hide.js | 0 {06-LongestWord => 18-LongestWord}/test.js | 0 18-NameChange/test.js | 28 ------------------ .../README.es.md | 2 +- .../README.md | 2 +- 19-MissingAngle/app.js | 1 + .../solution.hide.js | 0 {07-MissingAngle => 19-MissingAngle}/test.js | 0 .../README.es.md | 2 +- {08-NumberLimit => 20-NumberLimit}/README.md | 2 +- 20-NumberLimit/app.js | 1 + .../solution.hide.js | 0 {08-NumberLimit => 20-NumberLimit}/test.js | 0 110 files changed, 180 insertions(+), 97 deletions(-) create mode 100644 .learn/reports/08-Fibonacci.json create mode 100644 .learn/reports/12-NameChange.json rename {11-ConcatenateArrays => .learn/resets/03-ConcatenateArrays}/app.js (100%) rename {12-DateTime => .learn/resets/05-DateTime}/app.js (100%) rename {03-DivisibleBy5 => .learn/resets/06-DivisibleBy5}/app.js (100%) rename {13-Factorial => .learn/resets/07-Factorial}/app.js (100%) create mode 100644 .learn/resets/08-Fibonacci/app.js rename {14-Fibonacci => .learn/resets/09-FizzBuzz}/app.js (100%) rename {15-FizzBuzz => .learn/resets/10-CapitaliseLetters}/app.js (100%) rename {16-CapitaliseLetters => .learn/resets/11-MultiplyAndSkip}/app.js (100%) rename 18-NameChange/solution.hide.js => .learn/resets/12-NameChange/app.js (100%) rename {17-MultiplyAndSkip => .learn/resets/13-Palindrome}/app.js (100%) rename {18-NameChange => .learn/resets/14-RemoveCharacters}/app.js (100%) rename {05-AreaOfTriangle => .learn/resets/15-ShareCake}/app.js (100%) rename {06-LongestWord => .learn/resets/16-FormatPhoneNumber}/app.js (100%) rename {07-MissingAngle => .learn/resets/17-AreaOfTriangle}/app.js (100%) rename {08-NumberLimit => .learn/resets/18-LongestWord}/app.js (100%) rename {09-FormatPhoneNumber => .learn/resets/19-MissingAngle}/app.js (100%) rename {10-ShareCake => .learn/resets/20-NumberLimit}/app.js (100%) rename {11-ConcatenateArrays => 03-ConcatenateArrays}/README.es.md (87%) rename {11-ConcatenateArrays => 03-ConcatenateArrays}/README.md (87%) rename {19-Palindrome => 03-ConcatenateArrays}/app.js (100%) rename {11-ConcatenateArrays => 03-ConcatenateArrays}/solution.hide.js (100%) rename {11-ConcatenateArrays => 03-ConcatenateArrays}/test.js (100%) rename {12-DateTime => 05-DateTime}/README.es.md (94%) rename {12-DateTime => 05-DateTime}/README.md (94%) rename {20-RemoveCharacters => 05-DateTime}/app.js (100%) rename {12-DateTime => 05-DateTime}/solution.hide.js (100%) rename {12-DateTime => 05-DateTime}/test.js (100%) rename {03-DivisibleBy5 => 06-DivisibleBy5}/README.es.md (84%) rename {03-DivisibleBy5 => 06-DivisibleBy5}/README.md (84%) create mode 100644 06-DivisibleBy5/app.js rename {03-DivisibleBy5 => 06-DivisibleBy5}/solution.hide.js (100%) rename {03-DivisibleBy5 => 06-DivisibleBy5}/test.js (100%) rename {13-Factorial => 07-Factorial}/README.es.md (96%) rename {13-Factorial => 07-Factorial}/README.md (96%) create mode 100644 07-Factorial/app.js rename {13-Factorial => 07-Factorial}/solution.hide.js (100%) rename {13-Factorial => 07-Factorial}/test.js (100%) rename {14-Fibonacci => 08-Fibonacci}/README.es.md (66%) rename {14-Fibonacci => 08-Fibonacci}/README.md (64%) create mode 100644 08-Fibonacci/app.js create mode 100644 08-Fibonacci/solution.hide.js rename {14-Fibonacci => 08-Fibonacci}/test.js (58%) rename {15-FizzBuzz => 09-FizzBuzz}/README.es.md (94%) rename {15-FizzBuzz => 09-FizzBuzz}/README.md (94%) create mode 100644 09-FizzBuzz/app.js rename {15-FizzBuzz => 09-FizzBuzz}/solution.hide.js (100%) rename {15-FizzBuzz => 09-FizzBuzz}/test.js (100%) rename {16-CapitaliseLetters => 10-CapitaliseLetters}/README.es.md (87%) rename {16-CapitaliseLetters => 10-CapitaliseLetters}/README.md (85%) create mode 100644 10-CapitaliseLetters/app.js rename {16-CapitaliseLetters => 10-CapitaliseLetters}/solution.hide.js (100%) rename {16-CapitaliseLetters => 10-CapitaliseLetters}/test.js (100%) rename {17-MultiplyAndSkip => 11-MultiplyAndSkip}/README.es.md (83%) rename {17-MultiplyAndSkip => 11-MultiplyAndSkip}/README.md (83%) create mode 100644 11-MultiplyAndSkip/app.js rename {17-MultiplyAndSkip => 11-MultiplyAndSkip}/solution.hide.js (100%) rename {17-MultiplyAndSkip => 11-MultiplyAndSkip}/test.js (100%) rename {18-NameChange => 12-NameChange}/README.es.md (88%) rename {18-NameChange => 12-NameChange}/README.md (87%) create mode 100644 12-NameChange/app.js create mode 100644 12-NameChange/solution.hide.js create mode 100644 12-NameChange/test.js rename {19-Palindrome => 13-Palindrome}/README.es.md (95%) rename {19-Palindrome => 13-Palindrome}/README.md (95%) create mode 100644 13-Palindrome/app.js rename {19-Palindrome => 13-Palindrome}/solution.hide.js (100%) rename {19-Palindrome => 13-Palindrome}/test.js (100%) delete mode 100644 14-Fibonacci/solution.hide.js rename {20-RemoveCharacters => 14-RemoveCharacters}/README.es.md (85%) rename {20-RemoveCharacters => 14-RemoveCharacters}/README.md (85%) create mode 100644 14-RemoveCharacters/app.js rename {20-RemoveCharacters => 14-RemoveCharacters}/solution.hide.js (100%) rename {20-RemoveCharacters => 14-RemoveCharacters}/test.js (100%) rename {10-ShareCake => 15-ShareCake}/README.es.md (94%) rename {10-ShareCake => 15-ShareCake}/README.md (93%) create mode 100644 15-ShareCake/app.js rename {10-ShareCake => 15-ShareCake}/solution.hide.js (100%) rename {10-ShareCake => 15-ShareCake}/test.js (100%) rename {09-FormatPhoneNumber => 16-FormatPhoneNumber}/README.es.md (92%) rename {09-FormatPhoneNumber => 16-FormatPhoneNumber}/README.md (91%) create mode 100644 16-FormatPhoneNumber/app.js rename {09-FormatPhoneNumber => 16-FormatPhoneNumber}/solution.hide.js (100%) rename {09-FormatPhoneNumber => 16-FormatPhoneNumber}/test.js (100%) rename {05-AreaOfTriangle => 17-AreaOfTriangle}/README.es.md (82%) rename {05-AreaOfTriangle => 17-AreaOfTriangle}/README.md (82%) create mode 100644 17-AreaOfTriangle/app.js rename {05-AreaOfTriangle => 17-AreaOfTriangle}/solution.hide.js (100%) rename {05-AreaOfTriangle => 17-AreaOfTriangle}/test.js (100%) rename {06-LongestWord => 18-LongestWord}/README.es.md (87%) rename {06-LongestWord => 18-LongestWord}/README.md (87%) create mode 100644 18-LongestWord/app.js rename {06-LongestWord => 18-LongestWord}/solution.hide.js (100%) rename {06-LongestWord => 18-LongestWord}/test.js (100%) delete mode 100644 18-NameChange/test.js rename {07-MissingAngle => 19-MissingAngle}/README.es.md (92%) rename {07-MissingAngle => 19-MissingAngle}/README.md (93%) create mode 100644 19-MissingAngle/app.js rename {07-MissingAngle => 19-MissingAngle}/solution.hide.js (100%) rename {07-MissingAngle => 19-MissingAngle}/test.js (100%) rename {08-NumberLimit => 20-NumberLimit}/README.es.md (95%) rename {08-NumberLimit => 20-NumberLimit}/README.md (95%) create mode 100644 20-NumberLimit/app.js rename {08-NumberLimit => 20-NumberLimit}/solution.hide.js (100%) rename {08-NumberLimit => 20-NumberLimit}/test.js (100%) diff --git a/.learn/reports/08-Fibonacci.json b/.learn/reports/08-Fibonacci.json new file mode 100644 index 0000000..4e380a7 --- /dev/null +++ b/.learn/reports/08-Fibonacci.json @@ -0,0 +1,21 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 2, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "fib function must exist.", + "status": "passed" + }, + { + "title": "fib function must return n amount of Fibonacci numbers.", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/12-NameChange.json b/.learn/reports/12-NameChange.json new file mode 100644 index 0000000..71142c3 --- /dev/null +++ b/.learn/reports/12-NameChange.json @@ -0,0 +1,29 @@ +{ + "success": false, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 4, + "testResults": [ + { + "message": null + } + ], + "failed": [ + { + "title": "Person object function must exist", + "status": "passed" + }, + { + "title": "firstName property must exist in Person object", + "status": "passed" + }, + { + "title": "lastName property must exist in Person object", + "status": "passed" + }, + { + "title": "I should be able to change my last name.", + "status": "passed" + } + ] +} \ No newline at end of file diff --git a/.learn/reports/18-NameChange.json b/.learn/reports/18-NameChange.json index bc0477d..71142c3 100644 --- a/.learn/reports/18-NameChange.json +++ b/.learn/reports/18-NameChange.json @@ -1,11 +1,11 @@ { "success": false, - "numFailedTestSuites": 1, - "numFailedTests": 4, - "numPassedTests": 1, + "numFailedTestSuites": 0, + "numFailedTests": 0, + "numPassedTests": 4, "testResults": [ { - "message": "\u001b[1m\u001b[31m \u001b[1m● \u001b[1mchangeName method must exist\u001b[39m\u001b[22m\n\n ReferenceError: changeName is not defined\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat eval (eval at __get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16), :1:1)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object.__get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object. (\u001b[2m\u001b[0m\u001b[36m18-NameChange/test.js\u001b[39m\u001b[0m\u001b[2m:9:26)\u001b[2m\u001b[22m\n\n\u001b[1m\u001b[31m \u001b[1m● \u001b[1mfirstName property must exist in Person object\u001b[39m\u001b[22m\n\n ReferenceError: firstName is not defined\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat eval (eval at __get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16), :1:1)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object.__get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object. (\u001b[2m\u001b[0m\u001b[36m18-NameChange/test.js\u001b[39m\u001b[0m\u001b[2m:13:25)\u001b[2m\u001b[22m\n\n\u001b[1m\u001b[31m \u001b[1m● \u001b[1mlastName property must exist in Person object\u001b[39m\u001b[22m\n\n ReferenceError: lastName is not defined\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat eval (eval at __get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16), :1:1)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object.__get__ (\u001b[2m18-NameChange/app.js\u001b[2m:26:16)\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object. (\u001b[2m\u001b[0m\u001b[36m18-NameChange/test.js\u001b[39m\u001b[0m\u001b[2m:17:24)\u001b[2m\u001b[22m\n\n\u001b[1m\u001b[31m \u001b[1m● \u001b[1mI should be able to change my last name.\u001b[39m\u001b[22m\n\n \u001b[2mexpect(\u001b[22m\u001b[31mreceived\u001b[39m\u001b[2m).\u001b[22mtoBe\u001b[2m(\u001b[22m\u001b[32mexpected\u001b[39m\u001b[2m) // Object.is equality\u001b[22m\n\n Expected: \u001b[32m\"Smith\"\u001b[39m\n Received: \u001b[31m\"Max\"\u001b[39m\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 25 |\u001b[39m personTest\u001b[33m.\u001b[39mchangeName(\u001b[32m\"Smith\"\u001b[39m)\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 26 |\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m\u001b[31m\u001b[1m>\u001b[2m\u001b[39m\u001b[90m 27 |\u001b[39m expect(personTest\u001b[33m.\u001b[39mfirstName)\u001b[33m.\u001b[39mtoBe(\u001b[32m\"Smith\"\u001b[39m)\u001b[33m;\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m |\u001b[39m \u001b[31m\u001b[1m^\u001b[2m\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 28 |\u001b[39m })\u001b[0m\u001b[22m\n\u001b[2m \u001b[0m \u001b[90m 29 |\u001b[39m\u001b[0m\u001b[22m\n\u001b[2m\u001b[22m\n\u001b[2m \u001b[2mat Object. (\u001b[2m\u001b[0m\u001b[36m18-NameChange/test.js\u001b[39m\u001b[0m\u001b[2m:27:34)\u001b[2m\u001b[22m\n" + "message": null } ], "failed": [ @@ -13,21 +13,17 @@ "title": "Person object function must exist", "status": "passed" }, - { - "title": "changeName method must exist", - "status": "failed" - }, { "title": "firstName property must exist in Person object", - "status": "failed" + "status": "passed" }, { "title": "lastName property must exist in Person object", - "status": "failed" + "status": "passed" }, { "title": "I should be able to change my last name.", - "status": "failed" + "status": "passed" } ] } \ No newline at end of file diff --git a/11-ConcatenateArrays/app.js b/.learn/resets/03-ConcatenateArrays/app.js similarity index 100% rename from 11-ConcatenateArrays/app.js rename to .learn/resets/03-ConcatenateArrays/app.js diff --git a/12-DateTime/app.js b/.learn/resets/05-DateTime/app.js similarity index 100% rename from 12-DateTime/app.js rename to .learn/resets/05-DateTime/app.js diff --git a/03-DivisibleBy5/app.js b/.learn/resets/06-DivisibleBy5/app.js similarity index 100% rename from 03-DivisibleBy5/app.js rename to .learn/resets/06-DivisibleBy5/app.js diff --git a/13-Factorial/app.js b/.learn/resets/07-Factorial/app.js similarity index 100% rename from 13-Factorial/app.js rename to .learn/resets/07-Factorial/app.js diff --git a/.learn/resets/08-Fibonacci/app.js b/.learn/resets/08-Fibonacci/app.js new file mode 100644 index 0000000..c721dd9 --- /dev/null +++ b/.learn/resets/08-Fibonacci/app.js @@ -0,0 +1,14 @@ +// your code here +function fib(n) { + const result = [0, 1]; + for (let i = 2; i < n; i++) { + if (result[i - 2] + result[i - 1] <= 10000) { + result.push(result[i - 2] + result[i - 1]); + } else { + i = n; + } + } + console.log(result); + return result; +} +fib(22); \ No newline at end of file diff --git a/14-Fibonacci/app.js b/.learn/resets/09-FizzBuzz/app.js similarity index 100% rename from 14-Fibonacci/app.js rename to .learn/resets/09-FizzBuzz/app.js diff --git a/15-FizzBuzz/app.js b/.learn/resets/10-CapitaliseLetters/app.js similarity index 100% rename from 15-FizzBuzz/app.js rename to .learn/resets/10-CapitaliseLetters/app.js diff --git a/16-CapitaliseLetters/app.js b/.learn/resets/11-MultiplyAndSkip/app.js similarity index 100% rename from 16-CapitaliseLetters/app.js rename to .learn/resets/11-MultiplyAndSkip/app.js diff --git a/18-NameChange/solution.hide.js b/.learn/resets/12-NameChange/app.js similarity index 100% rename from 18-NameChange/solution.hide.js rename to .learn/resets/12-NameChange/app.js diff --git a/17-MultiplyAndSkip/app.js b/.learn/resets/13-Palindrome/app.js similarity index 100% rename from 17-MultiplyAndSkip/app.js rename to .learn/resets/13-Palindrome/app.js diff --git a/18-NameChange/app.js b/.learn/resets/14-RemoveCharacters/app.js similarity index 100% rename from 18-NameChange/app.js rename to .learn/resets/14-RemoveCharacters/app.js diff --git a/05-AreaOfTriangle/app.js b/.learn/resets/15-ShareCake/app.js similarity index 100% rename from 05-AreaOfTriangle/app.js rename to .learn/resets/15-ShareCake/app.js diff --git a/06-LongestWord/app.js b/.learn/resets/16-FormatPhoneNumber/app.js similarity index 100% rename from 06-LongestWord/app.js rename to .learn/resets/16-FormatPhoneNumber/app.js diff --git a/07-MissingAngle/app.js b/.learn/resets/17-AreaOfTriangle/app.js similarity index 100% rename from 07-MissingAngle/app.js rename to .learn/resets/17-AreaOfTriangle/app.js diff --git a/08-NumberLimit/app.js b/.learn/resets/18-LongestWord/app.js similarity index 100% rename from 08-NumberLimit/app.js rename to .learn/resets/18-LongestWord/app.js diff --git a/09-FormatPhoneNumber/app.js b/.learn/resets/19-MissingAngle/app.js similarity index 100% rename from 09-FormatPhoneNumber/app.js rename to .learn/resets/19-MissingAngle/app.js diff --git a/10-ShareCake/app.js b/.learn/resets/20-NumberLimit/app.js similarity index 100% rename from 10-ShareCake/app.js rename to .learn/resets/20-NumberLimit/app.js diff --git a/.learn/vscode_queue.json b/.learn/vscode_queue.json index b3c37ca..992c6d7 100644 --- a/.learn/vscode_queue.json +++ b/.learn/vscode_queue.json @@ -1 +1 @@ -[{"name":"initializing","time":500892235.625},{"name":"reset","time":500892252.875},{"name":"configuration_loaded","time":500897251.041},{"name":"open_files","time":500729997,"data":["15-FizzBuzz/app.js"]},{"name":"open_files","time":500929551.541,"data":["15-FizzBuzz/app.js"]},{"name":"start_exercise","time":501351964.458,"data":"16-CapitaliseLetters"},{"name":"open_files","time":501357341.916,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501549047.625,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500921589.541,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500717524.375,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501205730.541,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500666054.166,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500939383.875,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500988679.083,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500834127.708,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":500762100.916,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501340377.791,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501078938.25,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501460777.041,"data":["16-CapitaliseLetters/app.js"]},{"name":"open_files","time":501175581.041,"data":["16-CapitaliseLetters/app.js"]},{"name":"start_exercise","time":501643093.833,"data":"17-MultiplyAndSkip"},{"name":"open_files","time":501649015.833,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500878883.5,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501400733.375,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500985226.416,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501672981.625,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500722237.333,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501120048.708,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501640697.125,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500880205.208,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":500989922.541,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501508953.375,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501551817.5,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501123446.125,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501278047.541,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501044040.208,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501924033.25,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501115199,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501101298.25,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501089286.708,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501602475.291,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501350358.958,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501258650.833,"data":["17-MultiplyAndSkip/app.js"]},{"name":"open_files","time":501366150.583,"data":["17-MultiplyAndSkip/app.js"]},{"name":"start_exercise","time":501444732.416,"data":"18-NameChange"},{"name":"open_files","time":501450687.541,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501685022.75,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501736526.166,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502081612.291,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501591754.833,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501534732.666,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501813778,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501441392.5,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502124360.125,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501721351.791,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501428256.958,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502190211.875,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502214464.916,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502015757.333,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502235618.083,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501734886.708,"data":["18-NameChange/app.js"]},{"name":"open_files","time":502174089.708,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501598825.041,"data":["18-NameChange/app.js"]},{"name":"open_files","time":501736396.416,"data":["18-NameChange/app.js"]},{"name":"start_exercise","time":502252975.875,"data":"19-Palindrome"},{"name":"open_files","time":502259305.708,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501537386.875,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501844115.291,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501650094.625,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501720039.708,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502211911.875,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502355018.375,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501495662.833,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501846967.333,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":501789317.041,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502329879.333,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502412714.833,"data":["19-Palindrome/app.js"]},{"name":"open_files","time":502187465.833,"data":["19-Palindrome/app.js"]},{"name":"start_exercise","time":501628358.166,"data":"20-RemoveCharacters"},{"name":"open_files","time":501634904.291,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501851912,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":502143265.375,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":502393028.75,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":502327855.625,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501990527.166,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501684958.625,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501596280.791,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501965760.75,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501985139.458,"data":["20-RemoveCharacters/app.js"]},{"name":"open_files","time":501995576.833,"data":["20-RemoveCharacters/app.js"]}] \ No newline at end of file +[{"name":"initializing","time":776813129.541},{"name":"reset","time":776813145.583},{"name":"configuration_loaded","time":776818357.5},{"name":"open_files","time":776407600.708,"data":["08-Fibonacci/app.js"]},{"name":"start_exercise","time":776075163.458,"data":"01-CheckNums"},{"name":"open_files","time":776086461.166,"data":["01-CheckNums/app.js"]},{"name":"open_files","time":776301029.791,"data":["01-CheckNums/app.js"]},{"name":"start_exercise","time":776164473.666,"data":"02-CompareStrings"},{"name":"open_files","time":776169709.416,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":776412380.666,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":776651472.875,"data":"03-ConcatenateArrays"},{"name":"open_files","time":776657134.333,"data":["03-ConcatenateArrays/app.js"]},{"name":"open_files","time":776840448,"data":["03-ConcatenateArrays/app.js"]},{"name":"start_exercise","time":776239675.75,"data":"02-CompareStrings"},{"name":"open_files","time":776245679.25,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":776467004.541,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":775981924.375,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":775922377.833,"data":"03-ConcatenateArrays"},{"name":"open_files","time":775927246.916,"data":["03-ConcatenateArrays/app.js"]},{"name":"open_files","time":776120436.625,"data":["03-ConcatenateArrays/app.js"]},{"name":"start_exercise","time":776694533.416,"data":"04-VowelCount"},{"name":"open_files","time":776698678.708,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":775891878.625,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":776493159.041,"data":["04-VowelCount/app.js"]},{"name":"start_exercise","time":776683471.666,"data":"05-DateTime"},{"name":"open_files","time":776687828.375,"data":["05-DateTime/app.js"]},{"name":"open_files","time":775895692.291,"data":["05-DateTime/app.js"]},{"name":"start_exercise","time":776476910.583,"data":"06-DivisibleBy5"},{"name":"open_files","time":776482717.083,"data":["06-DivisibleBy5/app.js"]},{"name":"open_files","time":776679125.916,"data":["06-DivisibleBy5/app.js"]},{"name":"open_files","time":776532253.333,"data":["06-DivisibleBy5/app.js"]},{"name":"start_exercise","time":776238427.25,"data":"07-Factorial"},{"name":"open_files","time":776247586.291,"data":["07-Factorial/app.js"]},{"name":"open_files","time":776466661.875,"data":["07-Factorial/app.js"]},{"name":"start_exercise","time":776590954.833,"data":"08-Fibonacci"},{"name":"open_files","time":776596904.166,"data":["08-Fibonacci/app.js"]},{"name":"open_files","time":776764678,"data":["08-Fibonacci/app.js"]},{"name":"start_exercise","time":776290085.083,"data":"09-FizzBuzz"},{"name":"open_files","time":776299038.166,"data":["09-FizzBuzz/app.js"]},{"name":"open_files","time":776491423.791,"data":["09-FizzBuzz/app.js"]},{"name":"start_exercise","time":776576355.083,"data":"08-Fibonacci"},{"name":"open_files","time":776580425.208,"data":["08-Fibonacci/app.js"]},{"name":"open_files","time":776785191.25,"data":["08-Fibonacci/app.js"]},{"name":"open_files","time":776255448.958,"data":["08-Fibonacci/app.js"]},{"name":"start_exercise","time":776531931.916,"data":"09-FizzBuzz"},{"name":"open_files","time":776535798.291,"data":["09-FizzBuzz/app.js"]},{"name":"start_exercise","time":776019877.708,"data":"10-CapitaliseLetters"},{"name":"open_files","time":776025853.5,"data":["10-CapitaliseLetters/app.js"]},{"name":"start_exercise","time":776634562.333,"data":"11-MultiplyAndSkip"},{"name":"open_files","time":776641322.708,"data":["11-MultiplyAndSkip/app.js"]},{"name":"open_files","time":776805273.875,"data":["11-MultiplyAndSkip/app.js"]},{"name":"start_exercise","time":776252516.333,"data":"12-NameChange"},{"name":"open_files","time":776257099.125,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776456476.041,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776642449.625,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776488149,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776076305.291,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776331788.583,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776190715.083,"data":["12-NameChange/app.js"]},{"name":"start_exercise","time":776615755.416,"data":"13-Palindrome"},{"name":"open_files","time":776618858.208,"data":["13-Palindrome/app.js"]},{"name":"start_exercise","time":776655021.708,"data":"14-RemoveCharacters"},{"name":"open_files","time":776661042.791,"data":["14-RemoveCharacters/app.js"]},{"name":"open_files","time":776841187.25,"data":["14-RemoveCharacters/app.js"]},{"name":"start_exercise","time":776247258,"data":"15-ShareCake"},{"name":"open_files","time":776251287.958,"data":["15-ShareCake/app.js"]},{"name":"start_exercise","time":776893910.375,"data":"16-FormatPhoneNumber"},{"name":"open_files","time":776903362.541,"data":["16-FormatPhoneNumber/app.js"]},{"name":"open_files","time":776101458.583,"data":["16-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":776113011,"data":"15-ShareCake"},{"name":"open_files","time":776117492.875,"data":["15-ShareCake/app.js"]},{"name":"open_files","time":776218099.916,"data":["15-ShareCake/app.js"]},{"name":"open_files","time":776130673.75,"data":["15-ShareCake/app.js"]},{"name":"start_exercise","time":776260402,"data":"16-FormatPhoneNumber"},{"name":"open_files","time":776265202.041,"data":["16-FormatPhoneNumber/app.js"]},{"name":"open_files","time":776642885.625,"data":["16-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":776209862.333,"data":"17-AreaOfTriangle"},{"name":"open_files","time":776213615.041,"data":["17-AreaOfTriangle/app.js"]},{"name":"open_files","time":776364394.666,"data":["17-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":776107639.583,"data":"18-LongestWord"},{"name":"open_files","time":776111222.208,"data":["18-LongestWord/app.js"]},{"name":"open_files","time":776216887.75,"data":["18-LongestWord/app.js"]},{"name":"open_files","time":775960132.708,"data":["18-LongestWord/app.js"]},{"name":"start_exercise","time":776834056.208,"data":"19-MissingAngle"},{"name":"open_files","time":776839810.125,"data":["19-MissingAngle/app.js"]},{"name":"open_files","time":776074458.666,"data":["19-MissingAngle/app.js"]},{"name":"start_exercise","time":776228903.125,"data":"18-LongestWord"},{"name":"open_files","time":776233044,"data":["18-LongestWord/app.js"]},{"name":"open_files","time":776333539.166,"data":["18-LongestWord/app.js"]},{"name":"start_exercise","time":776105905.958,"data":"19-MissingAngle"},{"name":"open_files","time":776109546.541,"data":["19-MissingAngle/app.js"]},{"name":"open_files","time":776206292.458,"data":["19-MissingAngle/app.js"]},{"name":"start_exercise","time":776681041.416,"data":"20-NumberLimit"},{"name":"open_files","time":776685822.416,"data":["20-NumberLimit/app.js"]},{"name":"open_files","time":776888859.458,"data":["20-NumberLimit/app.js"]}] \ No newline at end of file diff --git a/02-CompareStrings/app.js b/02-CompareStrings/app.js index 3e203df..851493a 100644 --- a/02-CompareStrings/app.js +++ b/02-CompareStrings/app.js @@ -1 +1 @@ -// your code here +// your code here \ No newline at end of file diff --git a/11-ConcatenateArrays/README.es.md b/03-ConcatenateArrays/README.es.md similarity index 87% rename from 11-ConcatenateArrays/README.es.md rename to 03-ConcatenateArrays/README.es.md index 537b1a9..a7f708e 100644 --- a/11-ConcatenateArrays/README.es.md +++ b/03-ConcatenateArrays/README.es.md @@ -1,4 +1,4 @@ -# `11` Concatenate Arrays +# `03` Concatenate Arrays ## Instrucciones 🗒 1. Crea una funcion `concatenateIntArrays` que una dos `integer` arrays. diff --git a/11-ConcatenateArrays/README.md b/03-ConcatenateArrays/README.md similarity index 87% rename from 11-ConcatenateArrays/README.md rename to 03-ConcatenateArrays/README.md index 81cc387..9650ba6 100644 --- a/11-ConcatenateArrays/README.md +++ b/03-ConcatenateArrays/README.md @@ -1,4 +1,4 @@ -# `11` Concatenate Arrays +# `03` Concatenate Arrays ## Instructions 🗒 1. Create a function `concatenateIntArrays` to concatenate two `integer` arrays. diff --git a/19-Palindrome/app.js b/03-ConcatenateArrays/app.js similarity index 100% rename from 19-Palindrome/app.js rename to 03-ConcatenateArrays/app.js diff --git a/11-ConcatenateArrays/solution.hide.js b/03-ConcatenateArrays/solution.hide.js similarity index 100% rename from 11-ConcatenateArrays/solution.hide.js rename to 03-ConcatenateArrays/solution.hide.js diff --git a/11-ConcatenateArrays/test.js b/03-ConcatenateArrays/test.js similarity index 100% rename from 11-ConcatenateArrays/test.js rename to 03-ConcatenateArrays/test.js diff --git a/04-VowelCount/app.js b/04-VowelCount/app.js index 3e203df..851493a 100644 --- a/04-VowelCount/app.js +++ b/04-VowelCount/app.js @@ -1 +1 @@ -// your code here +// your code here \ No newline at end of file diff --git a/12-DateTime/README.es.md b/05-DateTime/README.es.md similarity index 94% rename from 12-DateTime/README.es.md rename to 05-DateTime/README.es.md index a64765a..9569453 100644 --- a/12-DateTime/README.es.md +++ b/05-DateTime/README.es.md @@ -1,4 +1,4 @@ -# `12` Date and Time +# `05` Date and Time ## Instrucciones 🗒 1. Imprima la fecha y la hora actuales en el formato predeterminado. Asigne el resultado final a una variable `today`. diff --git a/12-DateTime/README.md b/05-DateTime/README.md similarity index 94% rename from 12-DateTime/README.md rename to 05-DateTime/README.md index 32467cb..d291b83 100644 --- a/12-DateTime/README.md +++ b/05-DateTime/README.md @@ -1,4 +1,4 @@ -# `12` Date and Time +# `05` Date and Time ## Instructions 🗒 1. Print the current date and time in default format. Assign the final result to a `today` variable. diff --git a/20-RemoveCharacters/app.js b/05-DateTime/app.js similarity index 100% rename from 20-RemoveCharacters/app.js rename to 05-DateTime/app.js diff --git a/12-DateTime/solution.hide.js b/05-DateTime/solution.hide.js similarity index 100% rename from 12-DateTime/solution.hide.js rename to 05-DateTime/solution.hide.js diff --git a/12-DateTime/test.js b/05-DateTime/test.js similarity index 100% rename from 12-DateTime/test.js rename to 05-DateTime/test.js diff --git a/03-DivisibleBy5/README.es.md b/06-DivisibleBy5/README.es.md similarity index 84% rename from 03-DivisibleBy5/README.es.md rename to 06-DivisibleBy5/README.es.md index 57f54a8..d94a207 100644 --- a/03-DivisibleBy5/README.es.md +++ b/06-DivisibleBy5/README.es.md @@ -1,4 +1,4 @@ -# `03` Divisible By 5 +# `06` Divisible By 5 ## Instrucciones 🗒 1. Crea una función que retorne `true` si un integral es dividido por `5`, y `false` si no lo es. \ No newline at end of file diff --git a/03-DivisibleBy5/README.md b/06-DivisibleBy5/README.md similarity index 84% rename from 03-DivisibleBy5/README.md rename to 06-DivisibleBy5/README.md index 9e56d6d..5b02337 100644 --- a/03-DivisibleBy5/README.md +++ b/06-DivisibleBy5/README.md @@ -1,4 +1,4 @@ -# `03` Divisible By 5 +# `06` Divisible By 5 ## Instructions 🗒 1. Create a function that returns `true` if an integer is divisible by `5`, and `false` otherwise. \ No newline at end of file diff --git a/06-DivisibleBy5/app.js b/06-DivisibleBy5/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/06-DivisibleBy5/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/03-DivisibleBy5/solution.hide.js b/06-DivisibleBy5/solution.hide.js similarity index 100% rename from 03-DivisibleBy5/solution.hide.js rename to 06-DivisibleBy5/solution.hide.js diff --git a/03-DivisibleBy5/test.js b/06-DivisibleBy5/test.js similarity index 100% rename from 03-DivisibleBy5/test.js rename to 06-DivisibleBy5/test.js diff --git a/13-Factorial/README.es.md b/07-Factorial/README.es.md similarity index 96% rename from 13-Factorial/README.es.md rename to 07-Factorial/README.es.md index a34d6bf..418b8c6 100644 --- a/13-Factorial/README.es.md +++ b/07-Factorial/README.es.md @@ -1,4 +1,4 @@ -# `13` Factorial +# `07` Factorial ## Instrucciones 🗒 1. Este desafío requiere que devuelvas el factorial de un número dado. diff --git a/13-Factorial/README.md b/07-Factorial/README.md similarity index 96% rename from 13-Factorial/README.md rename to 07-Factorial/README.md index 1dbe662..ce7da64 100644 --- a/13-Factorial/README.md +++ b/07-Factorial/README.md @@ -1,4 +1,4 @@ -# `13` Factorial +# `07` Factorial ## Instructions 🗒 1. This challenge requires you to return the factorial of a given number. diff --git a/07-Factorial/app.js b/07-Factorial/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/07-Factorial/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/13-Factorial/solution.hide.js b/07-Factorial/solution.hide.js similarity index 100% rename from 13-Factorial/solution.hide.js rename to 07-Factorial/solution.hide.js diff --git a/13-Factorial/test.js b/07-Factorial/test.js similarity index 100% rename from 13-Factorial/test.js rename to 07-Factorial/test.js diff --git a/14-Fibonacci/README.es.md b/08-Fibonacci/README.es.md similarity index 66% rename from 14-Fibonacci/README.es.md rename to 08-Fibonacci/README.es.md index 3ec2faa..b7f803e 100644 --- a/14-Fibonacci/README.es.md +++ b/08-Fibonacci/README.es.md @@ -1,5 +1,5 @@ -# `14` Fibonacci +# `08` Fibonacci La secuencia de Fibonacci es una secuencia de números cuya suma es los dos números anteriores (por ejemplo, 0, 1, 1, 2, 3, etc.). ## Instrucciones 🗒 -1. Usando `0` y `1` como valores iniciales, cree una función `fib` que imprima y retorna un array que contenga todos los números de Fibonacci hasta `10000`. \ No newline at end of file +1. Usando `0` y `1` como valores iniciales, cree una función `fib` que imprima y retorna un array que contenga `n` numeros de la secuencia de Fibonacci. \ No newline at end of file diff --git a/14-Fibonacci/README.md b/08-Fibonacci/README.md similarity index 64% rename from 14-Fibonacci/README.md rename to 08-Fibonacci/README.md index cb2a759..5bf3f80 100644 --- a/14-Fibonacci/README.md +++ b/08-Fibonacci/README.md @@ -1,5 +1,5 @@ -# `14` Fibonacci +# `08` Fibonacci The Fibonacci Sequence is a sequence of numbers whose sum is the two preceding numbers (e.g. 0, 1, 1, 2, 3, etc). ## Instructions 🗒 -1. Using `0` and `1` as the starting values, create a function `fib` that prints and returns an array containing all of the Fibonacci numbers up to `10000`. \ No newline at end of file +1. Using `0` and `1` as the starting values, create a function `fib` that prints and returns an array containing `n` numbers of the Fibonacci sequence. \ No newline at end of file diff --git a/08-Fibonacci/app.js b/08-Fibonacci/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/08-Fibonacci/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/08-Fibonacci/solution.hide.js b/08-Fibonacci/solution.hide.js new file mode 100644 index 0000000..51fac8c --- /dev/null +++ b/08-Fibonacci/solution.hide.js @@ -0,0 +1,10 @@ +function fib(n) { + const result = [0, 1]; + for (let i = 2; i < n; i++) { + result.push(result[i - 2] + result[i - 1]); + } + console.log(result.length); + return result; +} + +fib(22) \ No newline at end of file diff --git a/14-Fibonacci/test.js b/08-Fibonacci/test.js similarity index 58% rename from 14-Fibonacci/test.js rename to 08-Fibonacci/test.js index 181f13e..d153e2f 100644 --- a/14-Fibonacci/test.js +++ b/08-Fibonacci/test.js @@ -5,14 +5,13 @@ test("fib function must exist.", () => { const fib = app.__get__("fib"); expect(fib).toBeTruthy(); }); -test("fib function must return all the fibonacci numbers less than or equal to 10,000", () => { +test("fib function must return n amount of Fibonacci numbers.", () => { const fib = app.__get__("fib"); expect(fib(22)).toEqual([ 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, - 2584, 4181, 6765, + 2584, 4181, 6765, 10946 ]); -}); -test("fib function must return all the fibonacci numbers for any other given input | Do not hard code your answer!!", () => { - const fib = app.__get__("fib"); + expect(fib(22).length).toBe(22); expect(fib(14)).toEqual([0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233]); -}); + expect(fib(14).length).toBe(14); +}); \ No newline at end of file diff --git a/15-FizzBuzz/README.es.md b/09-FizzBuzz/README.es.md similarity index 94% rename from 15-FizzBuzz/README.es.md rename to 09-FizzBuzz/README.es.md index 70cdc2a..a122da3 100644 --- a/15-FizzBuzz/README.es.md +++ b/09-FizzBuzz/README.es.md @@ -1,4 +1,4 @@ -# `15` FizzBuzz +# `09` FizzBuzz Escriba un programa que imprima los números del 1 al 100. ## Instrucciones 🗒 diff --git a/15-FizzBuzz/README.md b/09-FizzBuzz/README.md similarity index 94% rename from 15-FizzBuzz/README.md rename to 09-FizzBuzz/README.md index b3a6709..d8d54c5 100644 --- a/15-FizzBuzz/README.md +++ b/09-FizzBuzz/README.md @@ -1,4 +1,4 @@ -# `15` FizzBuzz +# `09` FizzBuzz Write a program that prints the numbers from 1 to 100. ## Instructions 🗒 diff --git a/09-FizzBuzz/app.js b/09-FizzBuzz/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/09-FizzBuzz/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/15-FizzBuzz/solution.hide.js b/09-FizzBuzz/solution.hide.js similarity index 100% rename from 15-FizzBuzz/solution.hide.js rename to 09-FizzBuzz/solution.hide.js diff --git a/15-FizzBuzz/test.js b/09-FizzBuzz/test.js similarity index 100% rename from 15-FizzBuzz/test.js rename to 09-FizzBuzz/test.js diff --git a/16-CapitaliseLetters/README.es.md b/10-CapitaliseLetters/README.es.md similarity index 87% rename from 16-CapitaliseLetters/README.es.md rename to 10-CapitaliseLetters/README.es.md index e7ca88a..b1f6147 100644 --- a/16-CapitaliseLetters/README.es.md +++ b/10-CapitaliseLetters/README.es.md @@ -1,4 +1,4 @@ -# `16` Capitalise Letters +# `10` Capitalise Letters ## Instrucciones 🗒 1. Cree una función `caps` que convierta el primer carácter de cada palabra en mayúsculas. diff --git a/16-CapitaliseLetters/README.md b/10-CapitaliseLetters/README.md similarity index 85% rename from 16-CapitaliseLetters/README.md rename to 10-CapitaliseLetters/README.md index 314206a..3a6c3cc 100644 --- a/16-CapitaliseLetters/README.md +++ b/10-CapitaliseLetters/README.md @@ -1,4 +1,4 @@ -# `16` Capitalise Letters +# `10` Capitalise Letters ## Instructions 🗒 1. Create a function `caps` that converts the first character of each word to uppercase. diff --git a/10-CapitaliseLetters/app.js b/10-CapitaliseLetters/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/10-CapitaliseLetters/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/16-CapitaliseLetters/solution.hide.js b/10-CapitaliseLetters/solution.hide.js similarity index 100% rename from 16-CapitaliseLetters/solution.hide.js rename to 10-CapitaliseLetters/solution.hide.js diff --git a/16-CapitaliseLetters/test.js b/10-CapitaliseLetters/test.js similarity index 100% rename from 16-CapitaliseLetters/test.js rename to 10-CapitaliseLetters/test.js diff --git a/17-MultiplyAndSkip/README.es.md b/11-MultiplyAndSkip/README.es.md similarity index 83% rename from 17-MultiplyAndSkip/README.es.md rename to 11-MultiplyAndSkip/README.es.md index 4561dca..5cec343 100644 --- a/17-MultiplyAndSkip/README.es.md +++ b/11-MultiplyAndSkip/README.es.md @@ -1,4 +1,4 @@ -# `17` Multiply and Skip +# `11` Multiply and Skip ## Instrucciones 🗒 1. Itera del 1 al 100 inclusivo y imprime los múltiplos de `5` mientras **saltas** los múltiplos de `3`. \ No newline at end of file diff --git a/17-MultiplyAndSkip/README.md b/11-MultiplyAndSkip/README.md similarity index 83% rename from 17-MultiplyAndSkip/README.md rename to 11-MultiplyAndSkip/README.md index 7cd1b7e..e5a5459 100644 --- a/17-MultiplyAndSkip/README.md +++ b/11-MultiplyAndSkip/README.md @@ -1,4 +1,4 @@ -# `17` Multiply and Skip +# `11` Multiply and Skip ## Instructions 🗒 1. Iterate from 1 to 100 inclusive and print the multiples of `5` whilst **skipping** the multiples of `3`. \ No newline at end of file diff --git a/11-MultiplyAndSkip/app.js b/11-MultiplyAndSkip/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/11-MultiplyAndSkip/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/17-MultiplyAndSkip/solution.hide.js b/11-MultiplyAndSkip/solution.hide.js similarity index 100% rename from 17-MultiplyAndSkip/solution.hide.js rename to 11-MultiplyAndSkip/solution.hide.js diff --git a/17-MultiplyAndSkip/test.js b/11-MultiplyAndSkip/test.js similarity index 100% rename from 17-MultiplyAndSkip/test.js rename to 11-MultiplyAndSkip/test.js diff --git a/18-NameChange/README.es.md b/12-NameChange/README.es.md similarity index 88% rename from 18-NameChange/README.es.md rename to 12-NameChange/README.es.md index b7d8fb3..fecaf0f 100644 --- a/18-NameChange/README.es.md +++ b/12-NameChange/README.es.md @@ -1,4 +1,4 @@ -# `18` Name Change +# `12` Name Change ## Instrucciones 🗒 1. Cambia tu apellido usando una función constructora `Person`, la función `changeName` y una instancia de `objeto`. \ No newline at end of file diff --git a/18-NameChange/README.md b/12-NameChange/README.md similarity index 87% rename from 18-NameChange/README.md rename to 12-NameChange/README.md index 13b9891..d578df5 100644 --- a/18-NameChange/README.md +++ b/12-NameChange/README.md @@ -1,4 +1,4 @@ -# `18` Name Change +# `12` Name Change ## Instructions 🗒 1. Change your surname using a constructor function `Person`, the `changeName` function and an `object` instance. \ No newline at end of file diff --git a/12-NameChange/app.js b/12-NameChange/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/12-NameChange/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/12-NameChange/solution.hide.js b/12-NameChange/solution.hide.js new file mode 100644 index 0000000..646d630 --- /dev/null +++ b/12-NameChange/solution.hide.js @@ -0,0 +1,20 @@ +// your code here +function Person(firstName, lastName) { + this.firstName = firstName; + this.lastName = lastName; + // change name function + this.changeName = function (name) { + this.lastName = name; + }; +} + +// Object instance +const person1 = new Person("Sharon", "Goldsworth"); + +// changeName() changes last name +person1.changeName("Smith"); + +// Print new name +console.log( + `Person one is now called ${person1.firstName} ${person1.lastName}.` +); diff --git a/12-NameChange/test.js b/12-NameChange/test.js new file mode 100644 index 0000000..243420e --- /dev/null +++ b/12-NameChange/test.js @@ -0,0 +1,20 @@ +const rewire = require("rewire"); +const app = rewire("./app.js"); +const Person = app.__get__("Person"); +const person1 = new Person("John", "Calleway") + +test("Person object function must exist", () => { + expect(Person).toBeTruthy(); +}); +test("firstName property must exist in Person object", () => { + expect(person1.firstName).toBe("John"); +}); +test("lastName property must exist in Person object", () => { + expect(person1.lastName).toBe("Calleway"); +}); + +test("I should be able to change my last name.", () => { + person1.changeName("Lucas") + + expect(person1.lastName).toBe("Lucas"); +}) diff --git a/19-Palindrome/README.es.md b/13-Palindrome/README.es.md similarity index 95% rename from 19-Palindrome/README.es.md rename to 13-Palindrome/README.es.md index 7565226..0c3f897 100644 --- a/19-Palindrome/README.es.md +++ b/13-Palindrome/README.es.md @@ -1,4 +1,4 @@ -# `19` Palindrome +# `13` Palindrome Un palíndromo es una palabra, número u otra secuencia de caracteres que se lee igual hacia atrás que hacia adelante, como "Ana" o "Otto". También puede crear un palíndromo int. ## Instrucciones 🗒 diff --git a/19-Palindrome/README.md b/13-Palindrome/README.md similarity index 95% rename from 19-Palindrome/README.md rename to 13-Palindrome/README.md index cebd325..bd39eee 100644 --- a/19-Palindrome/README.md +++ b/13-Palindrome/README.md @@ -1,4 +1,4 @@ -# `19` Palindrome +# `13` Palindrome A palindrome is a word, number, or other sequence of characters which reads the same backward as forward, such as "madam" or "racecar". You can also create an int palindrome. ## Instructions 🗒 diff --git a/13-Palindrome/app.js b/13-Palindrome/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/13-Palindrome/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/19-Palindrome/solution.hide.js b/13-Palindrome/solution.hide.js similarity index 100% rename from 19-Palindrome/solution.hide.js rename to 13-Palindrome/solution.hide.js diff --git a/19-Palindrome/test.js b/13-Palindrome/test.js similarity index 100% rename from 19-Palindrome/test.js rename to 13-Palindrome/test.js diff --git a/14-Fibonacci/solution.hide.js b/14-Fibonacci/solution.hide.js deleted file mode 100644 index 4fce550..0000000 --- a/14-Fibonacci/solution.hide.js +++ /dev/null @@ -1,13 +0,0 @@ -function fib(n) { - const result = [0, 1]; - for (let i = 2; i < n; i++) { - if ((result[i - 2] + result[i - 1]) <= 10000){ - result.push(result[i - 2] + result[i - 1]); - }else{ - i = n; - } - } - console.log(result); - return result; -} -fib(22); \ No newline at end of file diff --git a/20-RemoveCharacters/README.es.md b/14-RemoveCharacters/README.es.md similarity index 85% rename from 20-RemoveCharacters/README.es.md rename to 14-RemoveCharacters/README.es.md index f66ceb5..5970ab7 100644 --- a/20-RemoveCharacters/README.es.md +++ b/14-RemoveCharacters/README.es.md @@ -1,4 +1,4 @@ -# `20` Remove Characters +# `14` Remove Characters ## Instrucciones 🗒 1. Cree una funcion `removeChars` que elimine el primer y el último carácter de un string. diff --git a/20-RemoveCharacters/README.md b/14-RemoveCharacters/README.md similarity index 85% rename from 20-RemoveCharacters/README.md rename to 14-RemoveCharacters/README.md index bd7e555..fd97527 100644 --- a/20-RemoveCharacters/README.md +++ b/14-RemoveCharacters/README.md @@ -1,4 +1,4 @@ -# `20` Remove Characters +# `14` Remove Characters ## Instructions 🗒 1. Create a function `removeChars` that removes the first and last characters from a string. diff --git a/14-RemoveCharacters/app.js b/14-RemoveCharacters/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/14-RemoveCharacters/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/20-RemoveCharacters/solution.hide.js b/14-RemoveCharacters/solution.hide.js similarity index 100% rename from 20-RemoveCharacters/solution.hide.js rename to 14-RemoveCharacters/solution.hide.js diff --git a/20-RemoveCharacters/test.js b/14-RemoveCharacters/test.js similarity index 100% rename from 20-RemoveCharacters/test.js rename to 14-RemoveCharacters/test.js diff --git a/10-ShareCake/README.es.md b/15-ShareCake/README.es.md similarity index 94% rename from 10-ShareCake/README.es.md rename to 15-ShareCake/README.es.md index dcad753..6acc6db 100644 --- a/10-ShareCake/README.es.md +++ b/15-ShareCake/README.es.md @@ -1,4 +1,4 @@ -# `10` Share the Cake +# `15` Share the Cake ## Instrucciones 🗒 1. Cree una función `sliceOfCake` que determine si es posible o no compartir el pastel de manera justa dados estos tres parámetros: `Total de rebanadas`, `Destinatarios`, `Rebanadas` cada uno. diff --git a/10-ShareCake/README.md b/15-ShareCake/README.md similarity index 93% rename from 10-ShareCake/README.md rename to 15-ShareCake/README.md index 9c05342..a854ae8 100644 --- a/10-ShareCake/README.md +++ b/15-ShareCake/README.md @@ -1,4 +1,4 @@ -# `10` Share the Cake +# `15` Share the Cake ## Instructions 🗒 1. Create a function `sliceOfCake`that determines whether or not it's possible to share the cake fairly given these three parameters: `Total slices`, `Recipients`, `Slices` each. diff --git a/15-ShareCake/app.js b/15-ShareCake/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/15-ShareCake/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/10-ShareCake/solution.hide.js b/15-ShareCake/solution.hide.js similarity index 100% rename from 10-ShareCake/solution.hide.js rename to 15-ShareCake/solution.hide.js diff --git a/10-ShareCake/test.js b/15-ShareCake/test.js similarity index 100% rename from 10-ShareCake/test.js rename to 15-ShareCake/test.js diff --git a/09-FormatPhoneNumber/README.es.md b/16-FormatPhoneNumber/README.es.md similarity index 92% rename from 09-FormatPhoneNumber/README.es.md rename to 16-FormatPhoneNumber/README.es.md index 46dbeec..9081015 100644 --- a/09-FormatPhoneNumber/README.es.md +++ b/16-FormatPhoneNumber/README.es.md @@ -1,4 +1,4 @@ -# `09` Format Phone Number +# `16` Format Phone Number ## Instrucciones 🗒 1. Cree una función `formatPhoneNumber` que tome un array de `10` números entre `0` y `9` y `retorne` una cadena de números formateados como un número de teléfono. diff --git a/09-FormatPhoneNumber/README.md b/16-FormatPhoneNumber/README.md similarity index 91% rename from 09-FormatPhoneNumber/README.md rename to 16-FormatPhoneNumber/README.md index eed3ae0..82627da 100644 --- a/09-FormatPhoneNumber/README.md +++ b/16-FormatPhoneNumber/README.md @@ -1,4 +1,4 @@ -# `09` Format Phone Number +# `16` Format Phone Number ## Instructions 🗒 1. Create a function `formatPhoneNumber` that takes an array of `10` numbers between `0` and `9`and `returns` a string of numbers formatted as a phone number. diff --git a/16-FormatPhoneNumber/app.js b/16-FormatPhoneNumber/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/16-FormatPhoneNumber/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/09-FormatPhoneNumber/solution.hide.js b/16-FormatPhoneNumber/solution.hide.js similarity index 100% rename from 09-FormatPhoneNumber/solution.hide.js rename to 16-FormatPhoneNumber/solution.hide.js diff --git a/09-FormatPhoneNumber/test.js b/16-FormatPhoneNumber/test.js similarity index 100% rename from 09-FormatPhoneNumber/test.js rename to 16-FormatPhoneNumber/test.js diff --git a/05-AreaOfTriangle/README.es.md b/17-AreaOfTriangle/README.es.md similarity index 82% rename from 05-AreaOfTriangle/README.es.md rename to 17-AreaOfTriangle/README.es.md index 8634444..49aec11 100644 --- a/05-AreaOfTriangle/README.es.md +++ b/17-AreaOfTriangle/README.es.md @@ -1,4 +1,4 @@ -# `05` Area Of The Triangle +# `17` Area Of The Triangle ## Instrucciones 🗒 1. Escribe una funcion `AreaOfTriangle` que toma la `base` y la `altura` de un triangulo y retorna su `area`. \ No newline at end of file diff --git a/05-AreaOfTriangle/README.md b/17-AreaOfTriangle/README.md similarity index 82% rename from 05-AreaOfTriangle/README.md rename to 17-AreaOfTriangle/README.md index d6e307e..551fe40 100644 --- a/05-AreaOfTriangle/README.md +++ b/17-AreaOfTriangle/README.md @@ -1,4 +1,4 @@ -# `05` Area Of The Triangle +# `17` Area Of The Triangle ## Instructions 🗒 1. Write a function `AreaOfTriangle` that takes the `base` and `height` of a triangle and print its `area`. \ No newline at end of file diff --git a/17-AreaOfTriangle/app.js b/17-AreaOfTriangle/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/17-AreaOfTriangle/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/05-AreaOfTriangle/solution.hide.js b/17-AreaOfTriangle/solution.hide.js similarity index 100% rename from 05-AreaOfTriangle/solution.hide.js rename to 17-AreaOfTriangle/solution.hide.js diff --git a/05-AreaOfTriangle/test.js b/17-AreaOfTriangle/test.js similarity index 100% rename from 05-AreaOfTriangle/test.js rename to 17-AreaOfTriangle/test.js diff --git a/06-LongestWord/README.es.md b/18-LongestWord/README.es.md similarity index 87% rename from 06-LongestWord/README.es.md rename to 18-LongestWord/README.es.md index b03ec44..4580e67 100644 --- a/06-LongestWord/README.es.md +++ b/18-LongestWord/README.es.md @@ -1,4 +1,4 @@ -# `06` Longest Word +# `18` Longest Word ## Instrucciones 🗒 1. Escribe una funcion `longestWord` que toma `(sen)` como un parametro y retorna la palabra más larga en una frase. \ No newline at end of file diff --git a/06-LongestWord/README.md b/18-LongestWord/README.md similarity index 87% rename from 06-LongestWord/README.md rename to 18-LongestWord/README.md index 3c18562..587b4ca 100644 --- a/06-LongestWord/README.md +++ b/18-LongestWord/README.md @@ -1,4 +1,4 @@ -# `06` Longest Word +# `18` Longest Word ## Instructions 🗒 1. Write a function `longestWord` that takes in `(sen)` as a parameter and returns the longest word in a sentence. \ No newline at end of file diff --git a/18-LongestWord/app.js b/18-LongestWord/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/18-LongestWord/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/06-LongestWord/solution.hide.js b/18-LongestWord/solution.hide.js similarity index 100% rename from 06-LongestWord/solution.hide.js rename to 18-LongestWord/solution.hide.js diff --git a/06-LongestWord/test.js b/18-LongestWord/test.js similarity index 100% rename from 06-LongestWord/test.js rename to 18-LongestWord/test.js diff --git a/18-NameChange/test.js b/18-NameChange/test.js deleted file mode 100644 index 681105f..0000000 --- a/18-NameChange/test.js +++ /dev/null @@ -1,28 +0,0 @@ -const rewire = require("rewire"); -const app = rewire("./app.js"); - -test("Person object function must exist", () => { - const Person = app.__get__("Person"); - expect(Person).toBeTruthy(); -}); -test("changeName method must exist", () => { - const changeName = app.__get__("changeName"); - expect(changeName).toBeTruthy(); -}); -test("firstName property must exist in Person object", () => { - const firstName = app.__get__("firstName"); - expect(firstName).toBeTruthy(); -}); -test("lastName property must exist in Person object", () => { - const lastName = app.__get__("lastName"); - expect(lastName).toBeTruthy(); -}); - -test("I should be able to change my last name.", () => { - const Person = app.__get__("Person") - const personTest = new Person("Max", "Gonz") - - personTest.changeName("Smith") - - expect(personTest.firstName).toBe("Smith"); -}) diff --git a/07-MissingAngle/README.es.md b/19-MissingAngle/README.es.md similarity index 92% rename from 07-MissingAngle/README.es.md rename to 19-MissingAngle/README.es.md index db29a8b..768e725 100644 --- a/07-MissingAngle/README.es.md +++ b/19-MissingAngle/README.es.md @@ -1,4 +1,4 @@ -# `07` Missing Angle +# `19` Missing Angle ## Instrucciones 🗒 1. Crea una funcion `missingAngle` que clasifica el angulo faltante como "agudo", "recto", or "obtuso" basado en los grados. diff --git a/07-MissingAngle/README.md b/19-MissingAngle/README.md similarity index 93% rename from 07-MissingAngle/README.md rename to 19-MissingAngle/README.md index de91f27..38255e6 100644 --- a/07-MissingAngle/README.md +++ b/19-MissingAngle/README.md @@ -1,4 +1,4 @@ -# `07` Missing Angle +# `19` Missing Angle ## Instructions 🗒 1. Create a function `missingAngle` that classifies the missing angle as either "Acute", "Right", or "Obtuse" based on its degrees. diff --git a/19-MissingAngle/app.js b/19-MissingAngle/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/19-MissingAngle/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/07-MissingAngle/solution.hide.js b/19-MissingAngle/solution.hide.js similarity index 100% rename from 07-MissingAngle/solution.hide.js rename to 19-MissingAngle/solution.hide.js diff --git a/07-MissingAngle/test.js b/19-MissingAngle/test.js similarity index 100% rename from 07-MissingAngle/test.js rename to 19-MissingAngle/test.js diff --git a/08-NumberLimit/README.es.md b/20-NumberLimit/README.es.md similarity index 95% rename from 08-NumberLimit/README.es.md rename to 20-NumberLimit/README.es.md index aed666d..897c563 100644 --- a/08-NumberLimit/README.es.md +++ b/20-NumberLimit/README.es.md @@ -1,4 +1,4 @@ -# `08` Number Limit +# `20` Number Limit ## Instrucciones 🗒 1. Escriba una función `numLimit` que tome tres argumentos numéricos (un número como entrada y los otros dos números que representan los puntos más bajo y más alto del rango). 2. Si el número cae dentro del rango, `retorna` el número. diff --git a/08-NumberLimit/README.md b/20-NumberLimit/README.md similarity index 95% rename from 08-NumberLimit/README.md rename to 20-NumberLimit/README.md index 9872c03..2509d9a 100644 --- a/08-NumberLimit/README.md +++ b/20-NumberLimit/README.md @@ -1,4 +1,4 @@ -# `08` Number Limit +# `20` Number Limit ## Instructions 🗒 1. Write a function `numLimit` which takes three number arguments (one number as an input and the other two numbers representing the lowest and highest points of the range). 2. If the number falls within the range, `return` the number. diff --git a/20-NumberLimit/app.js b/20-NumberLimit/app.js new file mode 100644 index 0000000..851493a --- /dev/null +++ b/20-NumberLimit/app.js @@ -0,0 +1 @@ +// your code here \ No newline at end of file diff --git a/08-NumberLimit/solution.hide.js b/20-NumberLimit/solution.hide.js similarity index 100% rename from 08-NumberLimit/solution.hide.js rename to 20-NumberLimit/solution.hide.js diff --git a/08-NumberLimit/test.js b/20-NumberLimit/test.js similarity index 100% rename from 08-NumberLimit/test.js rename to 20-NumberLimit/test.js From 53dd569d4d722cf05ddc23725404fb89c87684fd Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Mon, 27 Jun 2022 21:12:45 +0000 Subject: [PATCH 19/28] dockerfile and gitpod.yml file added --- .gitpod.dockerfile | 7 +++++++ .gitpod.yml | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .gitpod.dockerfile create mode 100644 .gitpod.yml diff --git a/.gitpod.dockerfile b/.gitpod.dockerfile new file mode 100644 index 0000000..4fdad7a --- /dev/null +++ b/.gitpod.dockerfile @@ -0,0 +1,7 @@ +FROM gitpod/workspace-full:latest + +USER gitpod + +RUN npm i jest@24.8.0 -g + +RUN npm i @learnpack/learnpack -g && learnpack plugins:install @learnpack/node \ No newline at end of file diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 0000000..816c5fc --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,19 @@ +image: + file: .gitpod.dockerfile + +ports: + - port: 3000 + onOpen: ignore + +vscode: + extensions: + - learn-pack.learnpack-vscode + +github: + prebuilds: + # enable for the master/default branch (defaults to true) + master: true + # enable for pull requests coming from this repo (defaults to true) + pullRequests: false + # add a "Review in Gitpod" button as a comment to pull requests (defaults to true) + addComment: false \ No newline at end of file From 35bce816e4c150a309e3cca6c625574122722a07 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez Date: Mon, 27 Jun 2022 21:22:49 +0000 Subject: [PATCH 20/28] learnpack clean ran --- .learn/reports/01-AreaOfTriangle.json | 29 -------------------- .learn/reports/02-CompareStrings.json | 25 ----------------- .learn/reports/03-DivisibleBy5.json | 21 --------------- .learn/reports/04-VowelCount.json | 21 --------------- .learn/reports/05-AreaOfTriangle.json | 21 --------------- .learn/reports/06-LongestWord.json | 21 --------------- .learn/reports/07-MissingAngle.json | 21 --------------- .learn/reports/08-Fibonacci.json | 21 --------------- .learn/reports/08-NumberLimit.json | 21 --------------- .learn/reports/09-FormatPhoneNumber.json | 21 --------------- .learn/reports/10-ShareCake.json | 21 --------------- .learn/reports/11-ConcatenateArrays.json | 21 --------------- .learn/reports/12-DateTime.json | 33 ----------------------- .learn/reports/12-NameChange.json | 29 -------------------- .learn/reports/13-Factorial.json | 21 --------------- .learn/reports/14-Fibonacci.json | 25 ----------------- .learn/reports/15-FizzBuzz.json | 17 ------------ .learn/reports/16-CapitaliseLetters.json | 25 ----------------- .learn/reports/17-MultiplyAndSkip.json | 17 ------------ .learn/reports/18-NameChange.json | 29 -------------------- .learn/reports/19-Palindrome.json | 21 --------------- .learn/reports/20-RemoveCharacters.json | 21 --------------- .learn/resets/01-AreaOfTriangle/app.js | 4 --- .learn/resets/01-CheckNums/app.js | 1 - .learn/resets/02-CompareStrings/app.js | 8 ------ .learn/resets/03-ConcatenateArrays/app.js | 1 - .learn/resets/03-DivisibleBy5/app.js | 4 --- .learn/resets/04-VowelCount/app.js | 8 ------ .learn/resets/05-AreaOfTriangle/app.js | 1 - .learn/resets/05-DateTime/app.js | 1 - .learn/resets/06-DivisibleBy5/app.js | 1 - .learn/resets/06-LongestWord/app.js | 1 - .learn/resets/07-Factorial/app.js | 1 - .learn/resets/07-MissingAngle/app.js | 1 - .learn/resets/08-Fibonacci/app.js | 14 ---------- .learn/resets/08-NumberLimit/app.js | 1 - .learn/resets/09-FizzBuzz/app.js | 1 - .learn/resets/09-FormatPhoneNumber/app.js | 1 - .learn/resets/10-CapitaliseLetters/app.js | 1 - .learn/resets/10-ShareCake/app.js | 1 - .learn/resets/11-ConcatenateArrays/app.js | 0 .learn/resets/11-MultiplyAndSkip/app.js | 1 - .learn/resets/12-DateTime/app.js | 0 .learn/resets/12-NameChange/app.js | 20 -------------- .learn/resets/13-Factorial/app.js | 0 .learn/resets/13-Palindrome/app.js | 1 - .learn/resets/14-Fibonacci/app.js | 1 - .learn/resets/14-RemoveCharacters/app.js | 1 - .learn/resets/15-FizzBuzz/app.js | 0 .learn/resets/15-ShareCake/app.js | 1 - .learn/resets/16-CapitaliseLetters/app.js | 0 .learn/resets/16-FormatPhoneNumber/app.js | 1 - .learn/resets/17-AreaOfTriangle/app.js | 1 - .learn/resets/17-MultiplyAndSkip/app.js | 0 .learn/resets/18-LongestWord/app.js | 1 - .learn/resets/18-NameChange/app.js | 0 .learn/resets/19-MissingAngle/app.js | 1 - .learn/resets/19-Palindrome/app.js | 0 .learn/resets/20-NumberLimit/app.js | 1 - .learn/resets/20-RemoveCharacters/app.js | 0 .learn/vscode_queue.json | 1 - learn.json | 22 +++------------ 62 files changed, 3 insertions(+), 603 deletions(-) delete mode 100644 .learn/reports/01-AreaOfTriangle.json delete mode 100644 .learn/reports/02-CompareStrings.json delete mode 100644 .learn/reports/03-DivisibleBy5.json delete mode 100644 .learn/reports/04-VowelCount.json delete mode 100644 .learn/reports/05-AreaOfTriangle.json delete mode 100644 .learn/reports/06-LongestWord.json delete mode 100644 .learn/reports/07-MissingAngle.json delete mode 100644 .learn/reports/08-Fibonacci.json delete mode 100644 .learn/reports/08-NumberLimit.json delete mode 100644 .learn/reports/09-FormatPhoneNumber.json delete mode 100644 .learn/reports/10-ShareCake.json delete mode 100644 .learn/reports/11-ConcatenateArrays.json delete mode 100644 .learn/reports/12-DateTime.json delete mode 100644 .learn/reports/12-NameChange.json delete mode 100644 .learn/reports/13-Factorial.json delete mode 100644 .learn/reports/14-Fibonacci.json delete mode 100644 .learn/reports/15-FizzBuzz.json delete mode 100644 .learn/reports/16-CapitaliseLetters.json delete mode 100644 .learn/reports/17-MultiplyAndSkip.json delete mode 100644 .learn/reports/18-NameChange.json delete mode 100644 .learn/reports/19-Palindrome.json delete mode 100644 .learn/reports/20-RemoveCharacters.json delete mode 100644 .learn/resets/01-AreaOfTriangle/app.js delete mode 100644 .learn/resets/01-CheckNums/app.js delete mode 100644 .learn/resets/02-CompareStrings/app.js delete mode 100644 .learn/resets/03-ConcatenateArrays/app.js delete mode 100644 .learn/resets/03-DivisibleBy5/app.js delete mode 100644 .learn/resets/04-VowelCount/app.js delete mode 100644 .learn/resets/05-AreaOfTriangle/app.js delete mode 100644 .learn/resets/05-DateTime/app.js delete mode 100644 .learn/resets/06-DivisibleBy5/app.js delete mode 100644 .learn/resets/06-LongestWord/app.js delete mode 100644 .learn/resets/07-Factorial/app.js delete mode 100644 .learn/resets/07-MissingAngle/app.js delete mode 100644 .learn/resets/08-Fibonacci/app.js delete mode 100644 .learn/resets/08-NumberLimit/app.js delete mode 100644 .learn/resets/09-FizzBuzz/app.js delete mode 100644 .learn/resets/09-FormatPhoneNumber/app.js delete mode 100644 .learn/resets/10-CapitaliseLetters/app.js delete mode 100644 .learn/resets/10-ShareCake/app.js delete mode 100644 .learn/resets/11-ConcatenateArrays/app.js delete mode 100644 .learn/resets/11-MultiplyAndSkip/app.js delete mode 100644 .learn/resets/12-DateTime/app.js delete mode 100644 .learn/resets/12-NameChange/app.js delete mode 100644 .learn/resets/13-Factorial/app.js delete mode 100644 .learn/resets/13-Palindrome/app.js delete mode 100644 .learn/resets/14-Fibonacci/app.js delete mode 100644 .learn/resets/14-RemoveCharacters/app.js delete mode 100644 .learn/resets/15-FizzBuzz/app.js delete mode 100644 .learn/resets/15-ShareCake/app.js delete mode 100644 .learn/resets/16-CapitaliseLetters/app.js delete mode 100644 .learn/resets/16-FormatPhoneNumber/app.js delete mode 100644 .learn/resets/17-AreaOfTriangle/app.js delete mode 100644 .learn/resets/17-MultiplyAndSkip/app.js delete mode 100644 .learn/resets/18-LongestWord/app.js delete mode 100644 .learn/resets/18-NameChange/app.js delete mode 100644 .learn/resets/19-MissingAngle/app.js delete mode 100644 .learn/resets/19-Palindrome/app.js delete mode 100644 .learn/resets/20-NumberLimit/app.js delete mode 100644 .learn/resets/20-RemoveCharacters/app.js delete mode 100644 .learn/vscode_queue.json diff --git a/.learn/reports/01-AreaOfTriangle.json b/.learn/reports/01-AreaOfTriangle.json deleted file mode 100644 index 99f3f10..0000000 --- a/.learn/reports/01-AreaOfTriangle.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 4, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "There should be a checkNums function", - "status": "passed" - }, - { - "title": "If num2 is bigger than num1 you should return true", - "status": "passed" - }, - { - "title": "If num2 is less than num1 you should return false", - "status": "passed" - }, - { - "title": "If num1 is EQUAL to num2 you should return -1", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/02-CompareStrings.json b/.learn/reports/02-CompareStrings.json deleted file mode 100644 index d4c3945..0000000 --- a/.learn/reports/02-CompareStrings.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 3, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "Function compareStrings should exist", - "status": "passed" - }, - { - "title": "If the strings have the same length it should be true", - "status": "passed" - }, - { - "title": "If the strings have the different lengths it should be false", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/03-DivisibleBy5.json b/.learn/reports/03-DivisibleBy5.json deleted file mode 100644 index 604fa13..0000000 --- a/.learn/reports/03-DivisibleBy5.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "Function divisibleBy5 should exist", - "status": "passed" - }, - { - "title": "Number should be divisible by 5", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/04-VowelCount.json b/.learn/reports/04-VowelCount.json deleted file mode 100644 index 9f1100d..0000000 --- a/.learn/reports/04-VowelCount.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "findVowels function must exist.", - "status": "passed" - }, - { - "title": "You must have the correct number of vowels", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/05-AreaOfTriangle.json b/.learn/reports/05-AreaOfTriangle.json deleted file mode 100644 index 2b490b6..0000000 --- a/.learn/reports/05-AreaOfTriangle.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "AreaOfTriangle function must exist.", - "status": "passed" - }, - { - "title": "The base for the triangle is correct", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/06-LongestWord.json b/.learn/reports/06-LongestWord.json deleted file mode 100644 index 9366186..0000000 --- a/.learn/reports/06-LongestWord.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "longestWord function must exist.", - "status": "passed" - }, - { - "title": "You should return the longest word", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/07-MissingAngle.json b/.learn/reports/07-MissingAngle.json deleted file mode 100644 index 4b8a02c..0000000 --- a/.learn/reports/07-MissingAngle.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "missingAngle function must exist.", - "status": "passed" - }, - { - "title": "The missing angle is correctly classified.", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/08-Fibonacci.json b/.learn/reports/08-Fibonacci.json deleted file mode 100644 index 4e380a7..0000000 --- a/.learn/reports/08-Fibonacci.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "fib function must exist.", - "status": "passed" - }, - { - "title": "fib function must return n amount of Fibonacci numbers.", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/08-NumberLimit.json b/.learn/reports/08-NumberLimit.json deleted file mode 100644 index 1482fcc..0000000 --- a/.learn/reports/08-NumberLimit.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "numLimit function must exist.", - "status": "passed" - }, - { - "title": "The missing angle is correctly classified.", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/09-FormatPhoneNumber.json b/.learn/reports/09-FormatPhoneNumber.json deleted file mode 100644 index f42866a..0000000 --- a/.learn/reports/09-FormatPhoneNumber.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "formatPhoneNumber function must exist.", - "status": "passed" - }, - { - "title": "Phone number must be formatted correctly.", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/10-ShareCake.json b/.learn/reports/10-ShareCake.json deleted file mode 100644 index 1b6ae32..0000000 --- a/.learn/reports/10-ShareCake.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "sliceOfCake function must exist.", - "status": "passed" - }, - { - "title": "Phone number must be formatted correctly.", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/11-ConcatenateArrays.json b/.learn/reports/11-ConcatenateArrays.json deleted file mode 100644 index 5d0be2b..0000000 --- a/.learn/reports/11-ConcatenateArrays.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "concatenateIntArrays function must exist.", - "status": "passed" - }, - { - "title": "The final output should be a mix of the two arrays", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/12-DateTime.json b/.learn/reports/12-DateTime.json deleted file mode 100644 index 4e7a33c..0000000 --- a/.learn/reports/12-DateTime.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 5, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "today variable must exist.", - "status": "passed" - }, - { - "title": "date variable must exist.", - "status": "passed" - }, - { - "title": "time variable must exist.", - "status": "passed" - }, - { - "title": "dateTime variable must exist.", - "status": "passed" - }, - { - "title": "today must be a date object", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/12-NameChange.json b/.learn/reports/12-NameChange.json deleted file mode 100644 index 71142c3..0000000 --- a/.learn/reports/12-NameChange.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 4, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "Person object function must exist", - "status": "passed" - }, - { - "title": "firstName property must exist in Person object", - "status": "passed" - }, - { - "title": "lastName property must exist in Person object", - "status": "passed" - }, - { - "title": "I should be able to change my last name.", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/13-Factorial.json b/.learn/reports/13-Factorial.json deleted file mode 100644 index 40f29b9..0000000 --- a/.learn/reports/13-Factorial.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "factorialize function must exist.", - "status": "passed" - }, - { - "title": "The factorials yield the correct answer.", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/14-Fibonacci.json b/.learn/reports/14-Fibonacci.json deleted file mode 100644 index 6af6749..0000000 --- a/.learn/reports/14-Fibonacci.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 3, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "fib function must exist.", - "status": "passed" - }, - { - "title": "fib function must return all the fibonacci numbers less than or equal to 10,000", - "status": "passed" - }, - { - "title": "fib function must return all the fibonacci numbers for any other given input | Do not hard code your answer!!", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/15-FizzBuzz.json b/.learn/reports/15-FizzBuzz.json deleted file mode 100644 index 4cbbd32..0000000 --- a/.learn/reports/15-FizzBuzz.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 1, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "Your output should be printing, fizz, buzz, fizzbuzz, or just a number depending on whether that number is divisible by 3, 5, 3 & 5, or none", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/16-CapitaliseLetters.json b/.learn/reports/16-CapitaliseLetters.json deleted file mode 100644 index 1dfaa8d..0000000 --- a/.learn/reports/16-CapitaliseLetters.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 3, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "You should be printing your result", - "status": "passed" - }, - { - "title": "caps function must exist", - "status": "passed" - }, - { - "title": "caps function must return strings in the correct format for any input", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/17-MultiplyAndSkip.json b/.learn/reports/17-MultiplyAndSkip.json deleted file mode 100644 index 4cbbd32..0000000 --- a/.learn/reports/17-MultiplyAndSkip.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 1, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "Your output should be printing, fizz, buzz, fizzbuzz, or just a number depending on whether that number is divisible by 3, 5, 3 & 5, or none", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/18-NameChange.json b/.learn/reports/18-NameChange.json deleted file mode 100644 index 71142c3..0000000 --- a/.learn/reports/18-NameChange.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 4, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "Person object function must exist", - "status": "passed" - }, - { - "title": "firstName property must exist in Person object", - "status": "passed" - }, - { - "title": "lastName property must exist in Person object", - "status": "passed" - }, - { - "title": "I should be able to change my last name.", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/19-Palindrome.json b/.learn/reports/19-Palindrome.json deleted file mode 100644 index 18ec701..0000000 --- a/.learn/reports/19-Palindrome.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "palindrome function must exist", - "status": "passed" - }, - { - "title": "The function should return if the string is a palidrone or not (true or false)", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/reports/20-RemoveCharacters.json b/.learn/reports/20-RemoveCharacters.json deleted file mode 100644 index aa41479..0000000 --- a/.learn/reports/20-RemoveCharacters.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "success": false, - "numFailedTestSuites": 0, - "numFailedTests": 0, - "numPassedTests": 2, - "testResults": [ - { - "message": null - } - ], - "failed": [ - { - "title": "removeChars function must exist", - "status": "passed" - }, - { - "title": "The function should return a string with the first and last characters remvoed", - "status": "passed" - } - ] -} \ No newline at end of file diff --git a/.learn/resets/01-AreaOfTriangle/app.js b/.learn/resets/01-AreaOfTriangle/app.js deleted file mode 100644 index 4b97e77..0000000 --- a/.learn/resets/01-AreaOfTriangle/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// your code here -function checkNums(num1, num2){ - return num2 > num1 ? true : num1 > num2 ? false : -1; -} \ No newline at end of file diff --git a/.learn/resets/01-CheckNums/app.js b/.learn/resets/01-CheckNums/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/01-CheckNums/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/02-CompareStrings/app.js b/.learn/resets/02-CompareStrings/app.js deleted file mode 100644 index fc789ff..0000000 --- a/.learn/resets/02-CompareStrings/app.js +++ /dev/null @@ -1,8 +0,0 @@ -// your code here -function compareStrings(string1, string2) { - if (string1.length === string2.length) { - return true - } else { - return false - } -} \ No newline at end of file diff --git a/.learn/resets/03-ConcatenateArrays/app.js b/.learn/resets/03-ConcatenateArrays/app.js deleted file mode 100644 index 851493a..0000000 --- a/.learn/resets/03-ConcatenateArrays/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here \ No newline at end of file diff --git a/.learn/resets/03-DivisibleBy5/app.js b/.learn/resets/03-DivisibleBy5/app.js deleted file mode 100644 index d3029b7..0000000 --- a/.learn/resets/03-DivisibleBy5/app.js +++ /dev/null @@ -1,4 +0,0 @@ -// your code here - function divisibleBy5(int) { - return int % 5 === 0 ? true : false; - } \ No newline at end of file diff --git a/.learn/resets/04-VowelCount/app.js b/.learn/resets/04-VowelCount/app.js deleted file mode 100644 index 7a19ec1..0000000 --- a/.learn/resets/04-VowelCount/app.js +++ /dev/null @@ -1,8 +0,0 @@ -// your code here -function findVowels(word){ - const matched = word.match(/[aeiou]/gi); - console.log(matched ? matched.length : 0); - return matched ? matched.length : 0; -} - -findVowels("carolas") \ No newline at end of file diff --git a/.learn/resets/05-AreaOfTriangle/app.js b/.learn/resets/05-AreaOfTriangle/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/05-AreaOfTriangle/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/05-DateTime/app.js b/.learn/resets/05-DateTime/app.js deleted file mode 100644 index 851493a..0000000 --- a/.learn/resets/05-DateTime/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here \ No newline at end of file diff --git a/.learn/resets/06-DivisibleBy5/app.js b/.learn/resets/06-DivisibleBy5/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/06-DivisibleBy5/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/06-LongestWord/app.js b/.learn/resets/06-LongestWord/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/06-LongestWord/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/07-Factorial/app.js b/.learn/resets/07-Factorial/app.js deleted file mode 100644 index 851493a..0000000 --- a/.learn/resets/07-Factorial/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here \ No newline at end of file diff --git a/.learn/resets/07-MissingAngle/app.js b/.learn/resets/07-MissingAngle/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/07-MissingAngle/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/08-Fibonacci/app.js b/.learn/resets/08-Fibonacci/app.js deleted file mode 100644 index c721dd9..0000000 --- a/.learn/resets/08-Fibonacci/app.js +++ /dev/null @@ -1,14 +0,0 @@ -// your code here -function fib(n) { - const result = [0, 1]; - for (let i = 2; i < n; i++) { - if (result[i - 2] + result[i - 1] <= 10000) { - result.push(result[i - 2] + result[i - 1]); - } else { - i = n; - } - } - console.log(result); - return result; -} -fib(22); \ No newline at end of file diff --git a/.learn/resets/08-NumberLimit/app.js b/.learn/resets/08-NumberLimit/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/08-NumberLimit/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/09-FizzBuzz/app.js b/.learn/resets/09-FizzBuzz/app.js deleted file mode 100644 index 851493a..0000000 --- a/.learn/resets/09-FizzBuzz/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here \ No newline at end of file diff --git a/.learn/resets/09-FormatPhoneNumber/app.js b/.learn/resets/09-FormatPhoneNumber/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/09-FormatPhoneNumber/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/10-CapitaliseLetters/app.js b/.learn/resets/10-CapitaliseLetters/app.js deleted file mode 100644 index 851493a..0000000 --- a/.learn/resets/10-CapitaliseLetters/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here \ No newline at end of file diff --git a/.learn/resets/10-ShareCake/app.js b/.learn/resets/10-ShareCake/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/10-ShareCake/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/11-ConcatenateArrays/app.js b/.learn/resets/11-ConcatenateArrays/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/.learn/resets/11-MultiplyAndSkip/app.js b/.learn/resets/11-MultiplyAndSkip/app.js deleted file mode 100644 index 851493a..0000000 --- a/.learn/resets/11-MultiplyAndSkip/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here \ No newline at end of file diff --git a/.learn/resets/12-DateTime/app.js b/.learn/resets/12-DateTime/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/.learn/resets/12-NameChange/app.js b/.learn/resets/12-NameChange/app.js deleted file mode 100644 index 646d630..0000000 --- a/.learn/resets/12-NameChange/app.js +++ /dev/null @@ -1,20 +0,0 @@ -// your code here -function Person(firstName, lastName) { - this.firstName = firstName; - this.lastName = lastName; - // change name function - this.changeName = function (name) { - this.lastName = name; - }; -} - -// Object instance -const person1 = new Person("Sharon", "Goldsworth"); - -// changeName() changes last name -person1.changeName("Smith"); - -// Print new name -console.log( - `Person one is now called ${person1.firstName} ${person1.lastName}.` -); diff --git a/.learn/resets/13-Factorial/app.js b/.learn/resets/13-Factorial/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/.learn/resets/13-Palindrome/app.js b/.learn/resets/13-Palindrome/app.js deleted file mode 100644 index 851493a..0000000 --- a/.learn/resets/13-Palindrome/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here \ No newline at end of file diff --git a/.learn/resets/14-Fibonacci/app.js b/.learn/resets/14-Fibonacci/app.js deleted file mode 100644 index 8b13789..0000000 --- a/.learn/resets/14-Fibonacci/app.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/.learn/resets/14-RemoveCharacters/app.js b/.learn/resets/14-RemoveCharacters/app.js deleted file mode 100644 index 851493a..0000000 --- a/.learn/resets/14-RemoveCharacters/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here \ No newline at end of file diff --git a/.learn/resets/15-FizzBuzz/app.js b/.learn/resets/15-FizzBuzz/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/.learn/resets/15-ShareCake/app.js b/.learn/resets/15-ShareCake/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/15-ShareCake/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/16-CapitaliseLetters/app.js b/.learn/resets/16-CapitaliseLetters/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/.learn/resets/16-FormatPhoneNumber/app.js b/.learn/resets/16-FormatPhoneNumber/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/16-FormatPhoneNumber/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/17-AreaOfTriangle/app.js b/.learn/resets/17-AreaOfTriangle/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/17-AreaOfTriangle/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/17-MultiplyAndSkip/app.js b/.learn/resets/17-MultiplyAndSkip/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/.learn/resets/18-LongestWord/app.js b/.learn/resets/18-LongestWord/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/18-LongestWord/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/18-NameChange/app.js b/.learn/resets/18-NameChange/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/.learn/resets/19-MissingAngle/app.js b/.learn/resets/19-MissingAngle/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/19-MissingAngle/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/19-Palindrome/app.js b/.learn/resets/19-Palindrome/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/.learn/resets/20-NumberLimit/app.js b/.learn/resets/20-NumberLimit/app.js deleted file mode 100644 index 3e203df..0000000 --- a/.learn/resets/20-NumberLimit/app.js +++ /dev/null @@ -1 +0,0 @@ -// your code here diff --git a/.learn/resets/20-RemoveCharacters/app.js b/.learn/resets/20-RemoveCharacters/app.js deleted file mode 100644 index e69de29..0000000 diff --git a/.learn/vscode_queue.json b/.learn/vscode_queue.json deleted file mode 100644 index 992c6d7..0000000 --- a/.learn/vscode_queue.json +++ /dev/null @@ -1 +0,0 @@ -[{"name":"initializing","time":776813129.541},{"name":"reset","time":776813145.583},{"name":"configuration_loaded","time":776818357.5},{"name":"open_files","time":776407600.708,"data":["08-Fibonacci/app.js"]},{"name":"start_exercise","time":776075163.458,"data":"01-CheckNums"},{"name":"open_files","time":776086461.166,"data":["01-CheckNums/app.js"]},{"name":"open_files","time":776301029.791,"data":["01-CheckNums/app.js"]},{"name":"start_exercise","time":776164473.666,"data":"02-CompareStrings"},{"name":"open_files","time":776169709.416,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":776412380.666,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":776651472.875,"data":"03-ConcatenateArrays"},{"name":"open_files","time":776657134.333,"data":["03-ConcatenateArrays/app.js"]},{"name":"open_files","time":776840448,"data":["03-ConcatenateArrays/app.js"]},{"name":"start_exercise","time":776239675.75,"data":"02-CompareStrings"},{"name":"open_files","time":776245679.25,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":776467004.541,"data":["02-CompareStrings/app.js"]},{"name":"open_files","time":775981924.375,"data":["02-CompareStrings/app.js"]},{"name":"start_exercise","time":775922377.833,"data":"03-ConcatenateArrays"},{"name":"open_files","time":775927246.916,"data":["03-ConcatenateArrays/app.js"]},{"name":"open_files","time":776120436.625,"data":["03-ConcatenateArrays/app.js"]},{"name":"start_exercise","time":776694533.416,"data":"04-VowelCount"},{"name":"open_files","time":776698678.708,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":775891878.625,"data":["04-VowelCount/app.js"]},{"name":"open_files","time":776493159.041,"data":["04-VowelCount/app.js"]},{"name":"start_exercise","time":776683471.666,"data":"05-DateTime"},{"name":"open_files","time":776687828.375,"data":["05-DateTime/app.js"]},{"name":"open_files","time":775895692.291,"data":["05-DateTime/app.js"]},{"name":"start_exercise","time":776476910.583,"data":"06-DivisibleBy5"},{"name":"open_files","time":776482717.083,"data":["06-DivisibleBy5/app.js"]},{"name":"open_files","time":776679125.916,"data":["06-DivisibleBy5/app.js"]},{"name":"open_files","time":776532253.333,"data":["06-DivisibleBy5/app.js"]},{"name":"start_exercise","time":776238427.25,"data":"07-Factorial"},{"name":"open_files","time":776247586.291,"data":["07-Factorial/app.js"]},{"name":"open_files","time":776466661.875,"data":["07-Factorial/app.js"]},{"name":"start_exercise","time":776590954.833,"data":"08-Fibonacci"},{"name":"open_files","time":776596904.166,"data":["08-Fibonacci/app.js"]},{"name":"open_files","time":776764678,"data":["08-Fibonacci/app.js"]},{"name":"start_exercise","time":776290085.083,"data":"09-FizzBuzz"},{"name":"open_files","time":776299038.166,"data":["09-FizzBuzz/app.js"]},{"name":"open_files","time":776491423.791,"data":["09-FizzBuzz/app.js"]},{"name":"start_exercise","time":776576355.083,"data":"08-Fibonacci"},{"name":"open_files","time":776580425.208,"data":["08-Fibonacci/app.js"]},{"name":"open_files","time":776785191.25,"data":["08-Fibonacci/app.js"]},{"name":"open_files","time":776255448.958,"data":["08-Fibonacci/app.js"]},{"name":"start_exercise","time":776531931.916,"data":"09-FizzBuzz"},{"name":"open_files","time":776535798.291,"data":["09-FizzBuzz/app.js"]},{"name":"start_exercise","time":776019877.708,"data":"10-CapitaliseLetters"},{"name":"open_files","time":776025853.5,"data":["10-CapitaliseLetters/app.js"]},{"name":"start_exercise","time":776634562.333,"data":"11-MultiplyAndSkip"},{"name":"open_files","time":776641322.708,"data":["11-MultiplyAndSkip/app.js"]},{"name":"open_files","time":776805273.875,"data":["11-MultiplyAndSkip/app.js"]},{"name":"start_exercise","time":776252516.333,"data":"12-NameChange"},{"name":"open_files","time":776257099.125,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776456476.041,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776642449.625,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776488149,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776076305.291,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776331788.583,"data":["12-NameChange/app.js"]},{"name":"open_files","time":776190715.083,"data":["12-NameChange/app.js"]},{"name":"start_exercise","time":776615755.416,"data":"13-Palindrome"},{"name":"open_files","time":776618858.208,"data":["13-Palindrome/app.js"]},{"name":"start_exercise","time":776655021.708,"data":"14-RemoveCharacters"},{"name":"open_files","time":776661042.791,"data":["14-RemoveCharacters/app.js"]},{"name":"open_files","time":776841187.25,"data":["14-RemoveCharacters/app.js"]},{"name":"start_exercise","time":776247258,"data":"15-ShareCake"},{"name":"open_files","time":776251287.958,"data":["15-ShareCake/app.js"]},{"name":"start_exercise","time":776893910.375,"data":"16-FormatPhoneNumber"},{"name":"open_files","time":776903362.541,"data":["16-FormatPhoneNumber/app.js"]},{"name":"open_files","time":776101458.583,"data":["16-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":776113011,"data":"15-ShareCake"},{"name":"open_files","time":776117492.875,"data":["15-ShareCake/app.js"]},{"name":"open_files","time":776218099.916,"data":["15-ShareCake/app.js"]},{"name":"open_files","time":776130673.75,"data":["15-ShareCake/app.js"]},{"name":"start_exercise","time":776260402,"data":"16-FormatPhoneNumber"},{"name":"open_files","time":776265202.041,"data":["16-FormatPhoneNumber/app.js"]},{"name":"open_files","time":776642885.625,"data":["16-FormatPhoneNumber/app.js"]},{"name":"start_exercise","time":776209862.333,"data":"17-AreaOfTriangle"},{"name":"open_files","time":776213615.041,"data":["17-AreaOfTriangle/app.js"]},{"name":"open_files","time":776364394.666,"data":["17-AreaOfTriangle/app.js"]},{"name":"start_exercise","time":776107639.583,"data":"18-LongestWord"},{"name":"open_files","time":776111222.208,"data":["18-LongestWord/app.js"]},{"name":"open_files","time":776216887.75,"data":["18-LongestWord/app.js"]},{"name":"open_files","time":775960132.708,"data":["18-LongestWord/app.js"]},{"name":"start_exercise","time":776834056.208,"data":"19-MissingAngle"},{"name":"open_files","time":776839810.125,"data":["19-MissingAngle/app.js"]},{"name":"open_files","time":776074458.666,"data":["19-MissingAngle/app.js"]},{"name":"start_exercise","time":776228903.125,"data":"18-LongestWord"},{"name":"open_files","time":776233044,"data":["18-LongestWord/app.js"]},{"name":"open_files","time":776333539.166,"data":["18-LongestWord/app.js"]},{"name":"start_exercise","time":776105905.958,"data":"19-MissingAngle"},{"name":"open_files","time":776109546.541,"data":["19-MissingAngle/app.js"]},{"name":"open_files","time":776206292.458,"data":["19-MissingAngle/app.js"]},{"name":"start_exercise","time":776681041.416,"data":"20-NumberLimit"},{"name":"open_files","time":776685822.416,"data":["20-NumberLimit/app.js"]},{"name":"open_files","time":776888859.458,"data":["20-NumberLimit/app.js"]}] \ No newline at end of file diff --git a/learn.json b/learn.json index 82a5b2b..5eec39a 100644 --- a/learn.json +++ b/learn.json @@ -1,33 +1,17 @@ { - "port": 3000, - "editor": { - "mode": null, - "agent": null, - "version": null - }, "dirPath": "./.learn", "configPath": "./learn.json", "outputPath": "./.learn/dist", "publicPath": "/preview", - "publicUrl": null, "language": "auto", "grading": "isolated", "exercisesPath": "./", - "webpackTemplate": null, "disableGrading": false, "disabledActions": [], "actions": [], - "entries": { - "html": "index.html", - "vanillajs": "index.js", - "react": "app.jsx", - "node": "app.js", - "python3": "app.py", - "java": "app.java" - }, "difficulty": "easy", "duration": 2, - "description": "10 javascript problems to test your knowledge", - "title": "Javascript 10 Challenges", - "slug": "javascript-10-challenges" + "description": "20 javascript problems to test your knowledge", + "title": "Javascript 20 Challenges", + "slug": "javascript-20-challenges" } \ No newline at end of file From 8327b2ac429a9dd4db118deb7b00c26762e58930 Mon Sep 17 00:00:00 2001 From: ErnestoXG Date: Tue, 28 Jun 2022 15:17:37 +0000 Subject: [PATCH 21/28] merge --- AreaOfTriangle.js | 6 --- CapitaliseEveryLetter.js | 8 --- CheckNums.js | 26 --------- CompareStrings.js | 10 ---- ConcatenateArrays.js | 7 --- DateTime.js | 6 --- DivisibleBy5.js | 19 ------- Factorial.js | 14 ----- Fibonacci.js | 11 ---- FizzBuzz.js | 29 ----------- FormatPhoneNumber.js | 10 ---- LongestWord.js | 13 ----- MultiplySkip.js | 18 ------- NameChange.js | 18 ------- Palindrome.js | 7 --- README.es.md | 110 +++++++++++++++++++++++++++++++++++++-- RemoveChars.js | 5 -- SplitCake.js | 29 ----------- VowelCount.js | 7 --- limitNumValue.js | 14 ----- missingAngle.js | 15 ------ 21 files changed, 107 insertions(+), 275 deletions(-) delete mode 100644 AreaOfTriangle.js delete mode 100644 CapitaliseEveryLetter.js delete mode 100644 CheckNums.js delete mode 100644 CompareStrings.js delete mode 100644 ConcatenateArrays.js delete mode 100644 DateTime.js delete mode 100644 DivisibleBy5.js delete mode 100644 Factorial.js delete mode 100644 Fibonacci.js delete mode 100644 FizzBuzz.js delete mode 100644 FormatPhoneNumber.js delete mode 100644 LongestWord.js delete mode 100644 MultiplySkip.js delete mode 100644 NameChange.js delete mode 100644 Palindrome.js delete mode 100644 RemoveChars.js delete mode 100644 SplitCake.js delete mode 100644 VowelCount.js delete mode 100644 limitNumValue.js delete mode 100644 missingAngle.js diff --git a/AreaOfTriangle.js b/AreaOfTriangle.js deleted file mode 100644 index 662900b..0000000 --- a/AreaOfTriangle.js +++ /dev/null @@ -1,6 +0,0 @@ -function AreaOfTriangle(b, h) { - const result = (b * h) / 2 - console.log(result) -} -AreaOfTriangle(6, 5) - diff --git a/CapitaliseEveryLetter.js b/CapitaliseEveryLetter.js deleted file mode 100644 index 227b1e6..0000000 --- a/CapitaliseEveryLetter.js +++ /dev/null @@ -1,8 +0,0 @@ -const caps = str => { - str = str.toLowerCase() - .split(' ') - .map((s) => s.charAt(0).toUpperCase() + s.substring(1)) - .join(' ') - console.log(str) -} -caps("javascript is a fantastic language.") \ No newline at end of file diff --git a/CheckNums.js b/CheckNums.js deleted file mode 100644 index c03283a..0000000 --- a/CheckNums.js +++ /dev/null @@ -1,26 +0,0 @@ -// SOLUTION 1: Using an if...else statement -function CheckNums(num1, num2) { - if (num2 > num1) { - console.log(true) - } else if (num2 === num1) { - console.log(-1) - } else { - console.log(false) - } - } - CheckNums(3, 5) - -// SOLUTION 2: Using a switch statement -function CheckNums(num1, num2) { - switch(true) { - case(num2 > num1): - console.log(true) - break - case(num2 === num1): - console.log(-1) - break - default: - console.log(false) - } - } -CheckNums(3, 5) diff --git a/CompareStrings.js b/CompareStrings.js deleted file mode 100644 index bf4f8cc..0000000 --- a/CompareStrings.js +++ /dev/null @@ -1,10 +0,0 @@ -function compareStrings(string1, string2) { - if (string1.length === string2.length) { - console.log(true) - } else { - console.log(false) - } -} -compareStrings("Are they the same length?", "No") - - diff --git a/ConcatenateArrays.js b/ConcatenateArrays.js deleted file mode 100644 index 6129e92..0000000 --- a/ConcatenateArrays.js +++ /dev/null @@ -1,7 +0,0 @@ -function concatenateIntArrays() { -const array1 = [1, 2, 3, 4, 5] -const array2 = [6, 7, 8, 9, 10] -const result = array1.concat(array2) -console.log(result) -} -concatenateIntArrays() \ No newline at end of file diff --git a/DateTime.js b/DateTime.js deleted file mode 100644 index c334290..0000000 --- a/DateTime.js +++ /dev/null @@ -1,6 +0,0 @@ -const today = new Date() -const date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate() -const time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds() -const dateTime = date+' '+time -console.log(dateTime) - diff --git a/DivisibleBy5.js b/DivisibleBy5.js deleted file mode 100644 index b9566ef..0000000 --- a/DivisibleBy5.js +++ /dev/null @@ -1,19 +0,0 @@ - // SOLUTION 1: Is divisible by 5 - function divisibleBy5(int) { - if (int % 5 === 0) { - console.log(true) - } else { - console.log(false) - } - } - divisibleBy5(3) - - - - - // SOLUTION 2: Ternary operator - function divisibleBy5(int) { - const result = int % 5 === 0 ? true : false - console.log(result) - } - divisibleBy5(3) \ No newline at end of file diff --git a/Factorial.js b/Factorial.js deleted file mode 100644 index 91b31f7..0000000 --- a/Factorial.js +++ /dev/null @@ -1,14 +0,0 @@ -function factorialize(num) { - // Step 1. Create a variable called result to store num - let result = num; - // If num = 0 OR num = 1, the factorial will return 1 - if (num === 0 || num === 1) - return 1; - // Step 2. Create the WHILE loop - while (num > 1) { - num--; // decrements by 1 at each iteration - result *= num; - } - console.log(result); -} -factorialize(5); diff --git a/Fibonacci.js b/Fibonacci.js deleted file mode 100644 index 3e1ee27..0000000 --- a/Fibonacci.js +++ /dev/null @@ -1,11 +0,0 @@ -// Each num is a sum of the two preceeding numbers -function fib(n) { - - const result = [0, 1]; - for (let i = 2; i < n; i++) { - result.push(result[i-2] + result[i-1]); - } - console.log(result) - - } - fib(8) diff --git a/FizzBuzz.js b/FizzBuzz.js deleted file mode 100644 index 3edf3d5..0000000 --- a/FizzBuzz.js +++ /dev/null @@ -1,29 +0,0 @@ -// SOLUTION 1: Using if...else statement -for (let i = 0; i < 101; i++) { - if (i % 3 === 0 && i % 5 === 0) { - console.log("FizzBuzz") - } else if (i % 3 === 0) { - console.log("Fizz") - } else if (i % 5 === 0) { - console.log("Buzz") - } else { - console.log(i) - } -} - -// SOLUTION 2: Using switch statement -for (let i = 0; i < 101; i++) { - switch(true) { - case(i % 3 === 0 && i % 5 === 0): - console.log("FizzBuzz") - break - case(i % 3 === 0): - console.log("Fizz") - break - case(i % 5 === 0): - console.log("Buzz") - break - default: - console.log(i) - } -} \ No newline at end of file diff --git a/FormatPhoneNumber.js b/FormatPhoneNumber.js deleted file mode 100644 index bc1772a..0000000 --- a/FormatPhoneNumber.js +++ /dev/null @@ -1,10 +0,0 @@ -// Create function that takes array of 10 numbers (between 0 and 9) -// & returns string of numbers formatted as phone number -function formatPhoneNumber(numbers) { -const args = Array.prototype.slice.call(arguments); -args.splice(6, 0, "-") -args.splice(2, 0, ") ") -args.splice(0, 0, "(") -console.log(args.join('')) -} -formatPhoneNumber(4, 4, 1, 2, 3, 4, 5, 6, 7, 8) \ No newline at end of file diff --git a/LongestWord.js b/LongestWord.js deleted file mode 100644 index 192b17e..0000000 --- a/LongestWord.js +++ /dev/null @@ -1,13 +0,0 @@ -function longestWord(sen) { - let str = sen.split(" ") - let longest = 0 - sen = null - for (let i = 0; i < str.length - 1; i++) { - if (longest < str[i].length) { - longest = str[i].length - sen = str[i] - } - } - console.log(sen) - } - longestWord("Well, which is the longest word?") \ No newline at end of file diff --git a/MultiplySkip.js b/MultiplySkip.js deleted file mode 100644 index fe7e12b..0000000 --- a/MultiplySkip.js +++ /dev/null @@ -1,18 +0,0 @@ -// SOLUTION 1: Using switch statement -for (i = 1; i <= 100; i++) { - switch(true) { - case(i % 3 === 0): - continue - case(i % 5 === 0): - console.log(i) - } -} - -// SOLUTION 2: Using if else statement -for (i = 1; i <= 100; i++) { - if (i % 3 === 0) { - continue - } else if (i % 5 === 0) { - console.log(i) - } -} \ No newline at end of file diff --git a/NameChange.js b/NameChange.js deleted file mode 100644 index 5eec885..0000000 --- a/NameChange.js +++ /dev/null @@ -1,18 +0,0 @@ -// Constructor function -function Person(firstName, lastName) { - this.firstName = firstName - this.lastName = lastName - // change name function - this.changeName = function (name) { - this.lastName = name - } - } - - // Object instance - const person1 = new Person("Sharon", "Goldsworth") - - // changeName() changes last name - person1.changeName("Smith") - - // Print new name - console.log(`Person one is now called ${person1.firstName} ${person1.lastName}.`) diff --git a/Palindrome.js b/Palindrome.js deleted file mode 100644 index fcf99ba..0000000 --- a/Palindrome.js +++ /dev/null @@ -1,7 +0,0 @@ -const palindrome = str => { - // turn string to lowercase - str = str.toLowerCase() -// split, reverse & join string and print -console.log(str === str.split('').reverse().join('')) -} -palindrome('anna') diff --git a/README.es.md b/README.es.md index 8473f88..790965a 100644 --- a/README.es.md +++ b/README.es.md @@ -1,4 +1,108 @@ -# Bienvenido a Javascript 10 Challenges -Has inicializado los ejercicios con grading=`incremental`; esto signigica que tus estudiantes completarán un solo tutorial con pasos claros e incrementales, desde el comienzo hasta el final. +# Desafíos de codificación JavaScript :computadora: +Este repositorio contiene un conjunto de desafíos de programación JavaScript junto con las soluciones. -Ejecuta `$ learnpack start` en la terminal para comenzar con los ejercicios. \ No newline at end of file +**Preguntas de desafío:** +Todos los desafíos se enumeran a continuación. + +**Soluciones:** +Los enlaces a las soluciones se proporcionan debajo de las preguntas. + +**Desafíos abiertos con el paquete de aprendizaje:** + +RETOS: + +**1. Números de cheques:** + Haga que la función ```checkNums(num1,num2)``` tome ambos parámetros que se pasan e imprima verdadero si num2 es mayor que num1, de lo contrario imprima falso. + Si los valores de los parámetros son iguales entre sí, imprima -1. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/CheckNums.js)** + +**2. Comparar cadenas:** + Cree una función que tome dos cadenas como argumentos y devuelva verdadero o falso + dependiendo de si el número total de caracteres en la primera cadena es igual a la + número total de caracteres en la segunda cadena. + +**[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/CompareStrings.js)** + +**3. Concatenar arreglos:** + Cree una función para concatenar dos matrices de enteros. + +**[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/ConcatenateArrays.js)** + +**4. Contar las vocales:** + Cree una función que tome una cadena e imprima el número de vocales que contiene. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/VowelCount.js)** + +**5. Fecha y hora:** :fecha: + - Imprime la fecha y hora actuales en el formato predeterminado. + - Imprime la fecha y hora actual en estilo localizado. + - Imprime la fecha y hora actuales con un patrón. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/DateTime.js)** + +**6. Divisible por 5:** + Cree una función que imprima verdadero si un número entero es divisible por 5 y falso en caso contrario. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/DivisibleBy5.js)** + +**7. Factorial:** + Este desafío requiere que devuelvas el factorial de un número dado. factorial de un numero + (num), es num multiplicado por (num-1) multiplicado por (num-2) y así sucesivamente hasta llegar al número 1. + Por ejemplo, el factorial de 4 es 4 * 3 * 2 * 1 = 24. Bucle de 1 a num, multiplicando cada número por + el anterior, hasta llegar al número. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/Factorial.js)** + +**8. Fibonacci:** + La secuencia de Fibonacci es una secuencia de números cuya suma es los dos números anteriores (por ejemplo, 0, 1, 1, 2, 3, etc.). + Usando 0 y 1 como valores iniciales, cree una función que imprima una matriz que contenga todos los valores de Fibonacci + Números hasta el 10000. + +**[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/Fibonacci.js)** + +**9. Efervescencia:** + Escriba un programa que imprima los números del 1 al 100. Pero para múltiplos de tres, escriba "Fizz" en lugar de + el número y para los múltiplos de cinco escriba “Buzz”. Para números que son múltiplos de tres y cinco + imprime "FizzBuzz". + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/FizzBuzz.js)** + +**10. Letras en mayúscula:** + Cree una función que convierta el primer carácter de cada palabra en mayúsculas. Imprime la cadena recién formateada. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/CapitaliseEveryLetter.js)** + +**11. Multiplicar y Saltar:** + Imprime los múltiplos de 5 saltando los múltiplos de 3. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/MultiplySkip.js)** + +**12.Cambio de nombre:** + Cambie su apellido usando una función constructora, la función changeName y una instancia de objeto. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/NameChange.js)** + +**13. Palíndromo:** + Dada una cadena de texto, imprime verdadero o falso indicando si el texto es o no un palíndromo. + Un palíndromo es una palabra, número u otra secuencia de caracteres que se lee igual hacia atrás que hacia adelante, + como "señora" o "coche de carreras". También puede crear un palíndromo int. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/Palindrome.js)** + +**14. Eliminar personajes:** + Elimina el primer y último carácter de una cadena. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/RemoveChars.js)** + +**15. Comparte el pastel:** :pastel: + Cree una función que determine si es posible o no compartir el pastel de manera justa dados estos tres + parámetros: + Sectores totales, Destinatarios, Sectores cada uno. + Está bien no usar todo el pastel. + Imprima verdadero si el pastel se puede compartir por igual, de lo contrario imprima falso. + + **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/SplitCake.js)** + +**dieciséis. Formatear número de teléfono:** +Cree una función que tome una matriz de 10 números entre 0 y 9 y devuelva una cadena de números con formato de ph \ No newline at end of file diff --git a/RemoveChars.js b/RemoveChars.js deleted file mode 100644 index 39d38a9..0000000 --- a/RemoveChars.js +++ /dev/null @@ -1,5 +0,0 @@ -function removeChars(str) { - const result = str.substring(1, str.length-1) - console.log(result) -} -removeChars("The first and last characters are removed") diff --git a/SplitCake.js b/SplitCake.js deleted file mode 100644 index 72e1c1d..0000000 --- a/SplitCake.js +++ /dev/null @@ -1,29 +0,0 @@ -// SOLUTION 1: Using if statement -const sliceOfCake = (totalSlices, recipients, slicesPerPerson) => { -if (recipients * slicesPerPerson < totalSlices) { - console.log(true) -} else { - console.log(false) -} - } -sliceOfCake(10, 3, 2) - -// SOLUTION 2: Using switch statement -const sliceOfCake = (totalSlices, recipients, slicesPerPerson) => { - switch(true) { - case(recipients * slicesPerPerson < totalSlices): - console.log(true) - break - default: - console.log(false) - } -} -sliceOfCake(10, 3, 2) - -// SOLUTION 3: Using the ternary operator -const sliceOfCake = (totalSlices, recipients, slicesPerPerson) => { - const result = recipients * slicesPerPerson < totalSlices ? true : false - console.log(result) -} -sliceOfCake(10, 3, 2) - diff --git a/VowelCount.js b/VowelCount.js deleted file mode 100644 index eef5d45..0000000 --- a/VowelCount.js +++ /dev/null @@ -1,7 +0,0 @@ -const findVowels = str => { -const matched = str.match(/[aeiou]/gi) -console.log(matched ? matched.length : 0) -} -findVowels('vowels') - - diff --git a/limitNumValue.js b/limitNumValue.js deleted file mode 100644 index adbd6a8..0000000 --- a/limitNumValue.js +++ /dev/null @@ -1,14 +0,0 @@ -const numLimit = (num, lowest, highest) => { -switch(true) { - case(num >= lowest && num <= highest): - console.log(num) - break - case(num < lowest): - console.log(lowest) - break - case(num > highest): - console.log(highest) - break -} -} -numLimit(5, 10, 20) \ No newline at end of file diff --git a/missingAngle.js b/missingAngle.js deleted file mode 100644 index 216102c..0000000 --- a/missingAngle.js +++ /dev/null @@ -1,15 +0,0 @@ -const missingAngle = (degree1, degree2) => { - const result = 180 - (degree1 + degree2) -switch(true) { - case(result < 90): - console.log('Acute') - break - case(result === 90): - console.log('Right') - break - case(result >= 90): - console.log('Obtuse') - break -} -} -missingAngle(7, 93) From a0d9f2e6c1d7485a0c25526ff4d70a62677d9470 Mon Sep 17 00:00:00 2001 From: ErnestoXG Date: Tue, 28 Jun 2022 15:20:16 +0000 Subject: [PATCH 22/28] updated gitpod btn --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 55eaf49..780268c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ All of the challenges are listed below. **Solutions:** The links to the solutions are provided below the questions. -**Open challenges with learnpack:** +**Open challenges with learnpack:** [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/UmiKami/javascript-challenges.git) CHALLENGES: From ebb9681418e25c15f21cb862d07ff05d601b69b4 Mon Sep 17 00:00:00 2001 From: Tomas Gonzalez <56565994+tommygonzaleza@users.noreply.github.com> Date: Thu, 30 Jun 2022 17:11:05 -0400 Subject: [PATCH 23/28] Update README.md --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 780268c..fbafaa9 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,9 @@ All of the challenges are listed below. **Solutions:** The links to the solutions are provided below the questions. -**Open challenges with learnpack:** -[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/UmiKami/javascript-challenges.git) +**Open challenges with learnpack:** + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/rahni1/javascript-challenges.git) CHALLENGES: From 7b4ef2c7a2d199600e07b9dbc781e7853dfd46a4 Mon Sep 17 00:00:00 2001 From: ErnestoXG <60261375+UmiKami@users.noreply.github.com> Date: Thu, 30 Jun 2022 17:12:59 -0400 Subject: [PATCH 24/28] Update README.es.md --- README.es.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.es.md b/README.es.md index 790965a..daab171 100644 --- a/README.es.md +++ b/README.es.md @@ -95,7 +95,7 @@ RETOS: **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/RemoveChars.js)** -**15. Comparte el pastel:** :pastel: +**15. Comparte el pastel:** 🍰 Cree una función que determine si es posible o no compartir el pastel de manera justa dados estos tres parámetros: Sectores totales, Destinatarios, Sectores cada uno. @@ -104,5 +104,5 @@ RETOS: **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/SplitCake.js)** -**dieciséis. Formatear número de teléfono:** -Cree una función que tome una matriz de 10 números entre 0 y 9 y devuelva una cadena de números con formato de ph \ No newline at end of file +**16. Formatear número de teléfono:** +Cree una función que tome una matriz de 10 números entre 0 y 9 y devuelva una cadena de números con formato de ph From 63025ab7b52f974caa73a3c193ab8b9c48bdd8b8 Mon Sep 17 00:00:00 2001 From: ErnestoXG <60261375+UmiKami@users.noreply.github.com> Date: Thu, 30 Jun 2022 17:14:15 -0400 Subject: [PATCH 25/28] Update README.es.md --- README.es.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.es.md b/README.es.md index daab171..d53641b 100644 --- a/README.es.md +++ b/README.es.md @@ -7,7 +7,9 @@ Todos los desafíos se enumeran a continuación. **Soluciones:** Los enlaces a las soluciones se proporcionan debajo de las preguntas. -**Desafíos abiertos con el paquete de aprendizaje:** +**Abrir desafios con learnpack:** + +[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io#https://github.com/rahni1/javascript-challenges.git) RETOS: From cc3022b316fec05a5825c22cb881e4a29f0397c5 Mon Sep 17 00:00:00 2001 From: ErnestoXG <60261375+UmiKami@users.noreply.github.com> Date: Tue, 5 Jul 2022 17:01:28 -0400 Subject: [PATCH 26/28] Update README.es.md Made corrections to Spanish transalation --- README.es.md | 77 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 50 insertions(+), 27 deletions(-) diff --git a/README.es.md b/README.es.md index d53641b..26faa3a 100644 --- a/README.es.md +++ b/README.es.md @@ -13,30 +13,30 @@ Los enlaces a las soluciones se proporcionan debajo de las preguntas. RETOS: -**1. Números de cheques:** +**1. Validacion de Números:** Haga que la función ```checkNums(num1,num2)``` tome ambos parámetros que se pasan e imprima verdadero si num2 es mayor que num1, de lo contrario imprima falso. Si los valores de los parámetros son iguales entre sí, imprima -1. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/CheckNums.js)** -**2. Comparar cadenas:** - Cree una función que tome dos cadenas como argumentos y devuelva verdadero o falso - dependiendo de si el número total de caracteres en la primera cadena es igual a la - número total de caracteres en la segunda cadena. +**2. Comparar Strings:** + Cree una función que tome dos strings como argumentos y devuelva true o false + dependiendo de si el número total de caracteres en el primer string es igual a la + número total de caracteres en el segundo string. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/CompareStrings.js)** -**3. Concatenar arreglos:** - Cree una función para concatenar dos matrices de enteros. +**3. Concatenar Arrays:** + Cree una función para concatenar dos arrays de tipo int. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/ConcatenateArrays.js)** -**4. Contar las vocales:** - Cree una función que tome una cadena e imprima el número de vocales que contiene. +**4. Contar las Vocales:** + Cree una función que tome un string e imprima el número de vocales que contiene. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/VowelCount.js)** -**5. Fecha y hora:** :fecha: +**5. Fecha y Hora:** 📅 - Imprime la fecha y hora actuales en el formato predeterminado. - Imprime la fecha y hora actual en estilo localizado. - Imprime la fecha y hora actuales con un patrón. @@ -44,12 +44,12 @@ RETOS: **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/DateTime.js)** **6. Divisible por 5:** - Cree una función que imprima verdadero si un número entero es divisible por 5 y falso en caso contrario. + Cree una función que imprima true si un número entero es divisible por 5 y false en caso contrario. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/DivisibleBy5.js)** **7. Factorial:** - Este desafío requiere que devuelvas el factorial de un número dado. factorial de un numero + Este desafío requiere que devuelvas el factorial de un número dado. El factorial de un numero (num), es num multiplicado por (num-1) multiplicado por (num-2) y así sucesivamente hasta llegar al número 1. Por ejemplo, el factorial de 4 es 4 * 3 * 2 * 1 = 24. Bucle de 1 a num, multiplicando cada número por el anterior, hasta llegar al número. @@ -58,20 +58,20 @@ RETOS: **8. Fibonacci:** La secuencia de Fibonacci es una secuencia de números cuya suma es los dos números anteriores (por ejemplo, 0, 1, 1, 2, 3, etc.). - Usando 0 y 1 como valores iniciales, cree una función que imprima una matriz que contenga todos los valores de Fibonacci - Números hasta el 10000. + Usando 0 y 1 como valores iniciales, cree una función que imprima un array que contenga todos los valores de Fibonacci + hasta el 10000. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/Fibonacci.js)** -**9. Efervescencia:** +**9. FizzBuzz:** Escriba un programa que imprima los números del 1 al 100. Pero para múltiplos de tres, escriba "Fizz" en lugar de el número y para los múltiplos de cinco escriba “Buzz”. Para números que son múltiplos de tres y cinco imprime "FizzBuzz". **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/FizzBuzz.js)** -**10. Letras en mayúscula:** - Cree una función que convierta el primer carácter de cada palabra en mayúsculas. Imprime la cadena recién formateada. +**10. Letras en Mayúscula:** + Cree una función que convierta el primer carácter de cada palabra en mayúsculas. Imprime el string recién formateado. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/CapitaliseEveryLetter.js)** @@ -80,31 +80,54 @@ RETOS: **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/MultiplySkip.js)** -**12.Cambio de nombre:** +**12.Cambio de Nombre:** Cambie su apellido usando una función constructora, la función changeName y una instancia de objeto. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/NameChange.js)** **13. Palíndromo:** - Dada una cadena de texto, imprime verdadero o falso indicando si el texto es o no un palíndromo. + Dado un string de texto, imprime true o false indicando si el texto es o no un palíndromo. Un palíndromo es una palabra, número u otra secuencia de caracteres que se lee igual hacia atrás que hacia adelante, - como "señora" o "coche de carreras". También puede crear un palíndromo int. + como "Ana" o "Otto". También puede crear un palíndromo de números enteros (int). **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/Palindrome.js)** -**14. Eliminar personajes:** - Elimina el primer y último carácter de una cadena. +**14. Eliminar Personajes:** + Elimina el primer y último carácter de un string. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/RemoveChars.js)** -**15. Comparte el pastel:** 🍰 +**15. Comparte el Pastel:** 🍰 Cree una función que determine si es posible o no compartir el pastel de manera justa dados estos tres parámetros: - Sectores totales, Destinatarios, Sectores cada uno. + Partes totales, Destinatarios, Partes cada uno. Está bien no usar todo el pastel. - Imprima verdadero si el pastel se puede compartir por igual, de lo contrario imprima falso. + Imprima true si el pastel se puede compartir por igual, de lo contrario imprima false. **[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/SplitCake.js)** -**16. Formatear número de teléfono:** -Cree una función que tome una matriz de 10 números entre 0 y 9 y devuelva una cadena de números con formato de ph +**16. Formatear Número de Teléfono:** +Cree una función que tome un array de 10 números entre 0 y 9 y devuelva un string de números con formato de número de teléfono. +La llamada a la función debería parecerse a algo como esto: ```formatPhoneNumber(4, 4, 1, 2, 3, 4, 5, 6, 7, 8).``` + +**[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/FormatPhoneNumber.js)** + +**17. Halla el Área de un Triángulo:** + Escribe una función que tome la base y la altura de un triángulo e imprima su área. +**[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/AreaOfTriangle.js)** + +**18. Palabra Más Larga:** +Escriba una función que tome (sen) como parámetro e imprima la palabra más larga en una oración. + +**[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/LongestWord.js)** + +**19. Ángulo Faltante:** +Cree una función que clasifique el ángulo faltante como "agudo", "derecho" u "obtuso" según sus grados. Proporcione dos números como argumentos y calcule el grado faltante sumando los dos números y restándolo de 180. + +**[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/missingAngle.js)** + +**20. Límite de Número:** +Escriba una función que tome tres argumentos numéricos (un número como entrada y los otros dos números que representan los puntos más bajo y más alto del rango). Si el número cae dentro del rango, imprima el número. +Si el número es menor que el límite inferior del rango, imprime el número del límite más bajo y si el número es mayor que el límite superior del rango, imprime el número del límite más alto. + +**[Solución](https://github.com/RahniKaurBansal/JS-Challenges/blob/master/limitNumValue.js)** From 826f9883471d56614b5e0618d619fac27803156f Mon Sep 17 00:00:00 2001 From: ErnestoXG Date: Thu, 7 Jul 2022 20:33:40 +0000 Subject: [PATCH 27/28] changed root of learnpack exercises and added owner's original exercises --- AreaOfTriangle.js | 6 ++++ CapitaliseEveryLetter.js | 8 +++++ CheckNums.js | 26 +++++++++++++++++ CompareStrings.js | 10 +++++++ ConcatenateArrays.js | 7 +++++ DateTime.js | 6 ++++ DivisibleBy5.js | 19 ++++++++++++ Factorial.js | 14 +++++++++ Fibonacci.js | 11 +++++++ FizzBuzz.js | 29 +++++++++++++++++++ FormatPhoneNumber.js | 10 +++++++ LongestWord.js | 13 +++++++++ MultiplySkip.js | 18 ++++++++++++ NameChange.js | 18 ++++++++++++ Palindrome.js | 7 +++++ RemoveChars.js | 5 ++++ SplitCake.js | 29 +++++++++++++++++++ VowelCount.js | 7 +++++ .../01-CheckNums}/README.es.md | 0 .../01-CheckNums}/README.md | 0 .../01-CheckNums}/app.js | 0 .../01-CheckNums}/solution.hide.js | 0 .../01-CheckNums}/test.js | 0 .../02-CompareStrings}/README.es.md | 0 .../02-CompareStrings}/README.md | 0 .../02-CompareStrings}/app.js | 0 .../02-CompareStrings}/solution.hide.js | 0 .../02-CompareStrings}/test.js | 0 .../03-ConcatenateArrays}/README.es.md | 0 .../03-ConcatenateArrays}/README.md | 0 .../03-ConcatenateArrays}/app.js | 0 .../03-ConcatenateArrays}/solution.hide.js | 0 .../03-ConcatenateArrays}/test.js | 0 .../04-VowelCount}/README.es.md | 0 .../04-VowelCount}/README.md | 0 .../04-VowelCount}/app.js | 0 .../04-VowelCount}/solution.hide.js | 0 .../04-VowelCount}/test.js | 0 .../05-DateTime}/README.es.md | 0 .../05-DateTime}/README.md | 0 {05-DateTime => exercises/05-DateTime}/app.js | 0 .../05-DateTime}/solution.hide.js | 0 .../05-DateTime}/test.js | 0 .../06-DivisibleBy5}/README.es.md | 0 .../06-DivisibleBy5}/README.md | 0 .../06-DivisibleBy5}/app.js | 0 .../06-DivisibleBy5}/solution.hide.js | 0 .../06-DivisibleBy5}/test.js | 0 .../07-Factorial}/README.es.md | 0 .../07-Factorial}/README.md | 0 .../07-Factorial}/app.js | 0 .../07-Factorial}/solution.hide.js | 0 .../07-Factorial}/test.js | 0 .../08-Fibonacci}/README.es.md | 0 .../08-Fibonacci}/README.md | 0 .../08-Fibonacci}/app.js | 0 .../08-Fibonacci}/solution.hide.js | 0 .../08-Fibonacci}/test.js | 0 .../09-FizzBuzz}/README.es.md | 0 .../09-FizzBuzz}/README.md | 0 {09-FizzBuzz => exercises/09-FizzBuzz}/app.js | 0 .../09-FizzBuzz}/solution.hide.js | 0 .../09-FizzBuzz}/test.js | 0 .../10-CapitaliseLetters}/README.es.md | 0 .../10-CapitaliseLetters}/README.md | 0 .../10-CapitaliseLetters}/app.js | 0 .../10-CapitaliseLetters}/solution.hide.js | 0 .../10-CapitaliseLetters}/test.js | 0 .../11-MultiplyAndSkip}/README.es.md | 0 .../11-MultiplyAndSkip}/README.md | 0 .../11-MultiplyAndSkip}/app.js | 0 .../11-MultiplyAndSkip}/solution.hide.js | 0 .../11-MultiplyAndSkip}/test.js | 0 .../12-NameChange}/README.es.md | 0 .../12-NameChange}/README.md | 0 .../12-NameChange}/app.js | 0 .../12-NameChange}/solution.hide.js | 0 .../12-NameChange}/test.js | 0 .../13-Palindrome}/README.es.md | 0 .../13-Palindrome}/README.md | 0 .../13-Palindrome}/app.js | 0 .../13-Palindrome}/solution.hide.js | 0 .../13-Palindrome}/test.js | 0 .../14-RemoveCharacters}/README.es.md | 0 .../14-RemoveCharacters}/README.md | 0 .../14-RemoveCharacters}/app.js | 0 .../14-RemoveCharacters}/solution.hide.js | 0 .../14-RemoveCharacters}/test.js | 0 .../15-ShareCake}/README.es.md | 0 .../15-ShareCake}/README.md | 0 .../15-ShareCake}/app.js | 0 .../15-ShareCake}/solution.hide.js | 0 .../15-ShareCake}/test.js | 0 .../16-FormatPhoneNumber}/README.es.md | 0 .../16-FormatPhoneNumber}/README.md | 0 .../16-FormatPhoneNumber}/app.js | 0 .../16-FormatPhoneNumber}/solution.hide.js | 0 .../16-FormatPhoneNumber}/test.js | 0 .../17-AreaOfTriangle}/README.es.md | 0 .../17-AreaOfTriangle}/README.md | 0 .../17-AreaOfTriangle}/app.js | 0 .../17-AreaOfTriangle}/solution.hide.js | 0 .../17-AreaOfTriangle}/test.js | 0 .../18-LongestWord}/README.es.md | 0 .../18-LongestWord}/README.md | 0 .../18-LongestWord}/app.js | 0 .../18-LongestWord}/solution.hide.js | 0 .../18-LongestWord}/test.js | 0 .../19-MissingAngle}/README.es.md | 0 .../19-MissingAngle}/README.md | 0 .../19-MissingAngle}/app.js | 0 .../19-MissingAngle}/solution.hide.js | 0 .../19-MissingAngle}/test.js | 0 .../20-NumberLimit}/README.es.md | 0 .../20-NumberLimit}/README.md | 0 .../20-NumberLimit}/app.js | 0 .../20-NumberLimit}/solution.hide.js | 0 .../20-NumberLimit}/test.js | 0 learn.json | 2 +- limitNumValue.js | 14 +++++++++ missingAngle.js | 15 ++++++++++ 121 files changed, 273 insertions(+), 1 deletion(-) create mode 100644 AreaOfTriangle.js create mode 100644 CapitaliseEveryLetter.js create mode 100644 CheckNums.js create mode 100644 CompareStrings.js create mode 100644 ConcatenateArrays.js create mode 100644 DateTime.js create mode 100644 DivisibleBy5.js create mode 100644 Factorial.js create mode 100644 Fibonacci.js create mode 100644 FizzBuzz.js create mode 100644 FormatPhoneNumber.js create mode 100644 LongestWord.js create mode 100644 MultiplySkip.js create mode 100644 NameChange.js create mode 100644 Palindrome.js create mode 100644 RemoveChars.js create mode 100644 SplitCake.js create mode 100644 VowelCount.js rename {01-CheckNums => exercises/01-CheckNums}/README.es.md (100%) rename {01-CheckNums => exercises/01-CheckNums}/README.md (100%) rename {01-CheckNums => exercises/01-CheckNums}/app.js (100%) rename {01-CheckNums => exercises/01-CheckNums}/solution.hide.js (100%) rename {01-CheckNums => exercises/01-CheckNums}/test.js (100%) rename {02-CompareStrings => exercises/02-CompareStrings}/README.es.md (100%) rename {02-CompareStrings => exercises/02-CompareStrings}/README.md (100%) rename {02-CompareStrings => exercises/02-CompareStrings}/app.js (100%) rename {02-CompareStrings => exercises/02-CompareStrings}/solution.hide.js (100%) rename {02-CompareStrings => exercises/02-CompareStrings}/test.js (100%) rename {03-ConcatenateArrays => exercises/03-ConcatenateArrays}/README.es.md (100%) rename {03-ConcatenateArrays => exercises/03-ConcatenateArrays}/README.md (100%) rename {03-ConcatenateArrays => exercises/03-ConcatenateArrays}/app.js (100%) rename {03-ConcatenateArrays => exercises/03-ConcatenateArrays}/solution.hide.js (100%) rename {03-ConcatenateArrays => exercises/03-ConcatenateArrays}/test.js (100%) rename {04-VowelCount => exercises/04-VowelCount}/README.es.md (100%) rename {04-VowelCount => exercises/04-VowelCount}/README.md (100%) rename {04-VowelCount => exercises/04-VowelCount}/app.js (100%) rename {04-VowelCount => exercises/04-VowelCount}/solution.hide.js (100%) rename {04-VowelCount => exercises/04-VowelCount}/test.js (100%) rename {05-DateTime => exercises/05-DateTime}/README.es.md (100%) rename {05-DateTime => exercises/05-DateTime}/README.md (100%) rename {05-DateTime => exercises/05-DateTime}/app.js (100%) rename {05-DateTime => exercises/05-DateTime}/solution.hide.js (100%) rename {05-DateTime => exercises/05-DateTime}/test.js (100%) rename {06-DivisibleBy5 => exercises/06-DivisibleBy5}/README.es.md (100%) rename {06-DivisibleBy5 => exercises/06-DivisibleBy5}/README.md (100%) rename {06-DivisibleBy5 => exercises/06-DivisibleBy5}/app.js (100%) rename {06-DivisibleBy5 => exercises/06-DivisibleBy5}/solution.hide.js (100%) rename {06-DivisibleBy5 => exercises/06-DivisibleBy5}/test.js (100%) rename {07-Factorial => exercises/07-Factorial}/README.es.md (100%) rename {07-Factorial => exercises/07-Factorial}/README.md (100%) rename {07-Factorial => exercises/07-Factorial}/app.js (100%) rename {07-Factorial => exercises/07-Factorial}/solution.hide.js (100%) rename {07-Factorial => exercises/07-Factorial}/test.js (100%) rename {08-Fibonacci => exercises/08-Fibonacci}/README.es.md (100%) rename {08-Fibonacci => exercises/08-Fibonacci}/README.md (100%) rename {08-Fibonacci => exercises/08-Fibonacci}/app.js (100%) rename {08-Fibonacci => exercises/08-Fibonacci}/solution.hide.js (100%) rename {08-Fibonacci => exercises/08-Fibonacci}/test.js (100%) rename {09-FizzBuzz => exercises/09-FizzBuzz}/README.es.md (100%) rename {09-FizzBuzz => exercises/09-FizzBuzz}/README.md (100%) rename {09-FizzBuzz => exercises/09-FizzBuzz}/app.js (100%) rename {09-FizzBuzz => exercises/09-FizzBuzz}/solution.hide.js (100%) rename {09-FizzBuzz => exercises/09-FizzBuzz}/test.js (100%) rename {10-CapitaliseLetters => exercises/10-CapitaliseLetters}/README.es.md (100%) rename {10-CapitaliseLetters => exercises/10-CapitaliseLetters}/README.md (100%) rename {10-CapitaliseLetters => exercises/10-CapitaliseLetters}/app.js (100%) rename {10-CapitaliseLetters => exercises/10-CapitaliseLetters}/solution.hide.js (100%) rename {10-CapitaliseLetters => exercises/10-CapitaliseLetters}/test.js (100%) rename {11-MultiplyAndSkip => exercises/11-MultiplyAndSkip}/README.es.md (100%) rename {11-MultiplyAndSkip => exercises/11-MultiplyAndSkip}/README.md (100%) rename {11-MultiplyAndSkip => exercises/11-MultiplyAndSkip}/app.js (100%) rename {11-MultiplyAndSkip => exercises/11-MultiplyAndSkip}/solution.hide.js (100%) rename {11-MultiplyAndSkip => exercises/11-MultiplyAndSkip}/test.js (100%) rename {12-NameChange => exercises/12-NameChange}/README.es.md (100%) rename {12-NameChange => exercises/12-NameChange}/README.md (100%) rename {12-NameChange => exercises/12-NameChange}/app.js (100%) rename {12-NameChange => exercises/12-NameChange}/solution.hide.js (100%) rename {12-NameChange => exercises/12-NameChange}/test.js (100%) rename {13-Palindrome => exercises/13-Palindrome}/README.es.md (100%) rename {13-Palindrome => exercises/13-Palindrome}/README.md (100%) rename {13-Palindrome => exercises/13-Palindrome}/app.js (100%) rename {13-Palindrome => exercises/13-Palindrome}/solution.hide.js (100%) rename {13-Palindrome => exercises/13-Palindrome}/test.js (100%) rename {14-RemoveCharacters => exercises/14-RemoveCharacters}/README.es.md (100%) rename {14-RemoveCharacters => exercises/14-RemoveCharacters}/README.md (100%) rename {14-RemoveCharacters => exercises/14-RemoveCharacters}/app.js (100%) rename {14-RemoveCharacters => exercises/14-RemoveCharacters}/solution.hide.js (100%) rename {14-RemoveCharacters => exercises/14-RemoveCharacters}/test.js (100%) rename {15-ShareCake => exercises/15-ShareCake}/README.es.md (100%) rename {15-ShareCake => exercises/15-ShareCake}/README.md (100%) rename {15-ShareCake => exercises/15-ShareCake}/app.js (100%) rename {15-ShareCake => exercises/15-ShareCake}/solution.hide.js (100%) rename {15-ShareCake => exercises/15-ShareCake}/test.js (100%) rename {16-FormatPhoneNumber => exercises/16-FormatPhoneNumber}/README.es.md (100%) rename {16-FormatPhoneNumber => exercises/16-FormatPhoneNumber}/README.md (100%) rename {16-FormatPhoneNumber => exercises/16-FormatPhoneNumber}/app.js (100%) rename {16-FormatPhoneNumber => exercises/16-FormatPhoneNumber}/solution.hide.js (100%) rename {16-FormatPhoneNumber => exercises/16-FormatPhoneNumber}/test.js (100%) rename {17-AreaOfTriangle => exercises/17-AreaOfTriangle}/README.es.md (100%) rename {17-AreaOfTriangle => exercises/17-AreaOfTriangle}/README.md (100%) rename {17-AreaOfTriangle => exercises/17-AreaOfTriangle}/app.js (100%) rename {17-AreaOfTriangle => exercises/17-AreaOfTriangle}/solution.hide.js (100%) rename {17-AreaOfTriangle => exercises/17-AreaOfTriangle}/test.js (100%) rename {18-LongestWord => exercises/18-LongestWord}/README.es.md (100%) rename {18-LongestWord => exercises/18-LongestWord}/README.md (100%) rename {18-LongestWord => exercises/18-LongestWord}/app.js (100%) rename {18-LongestWord => exercises/18-LongestWord}/solution.hide.js (100%) rename {18-LongestWord => exercises/18-LongestWord}/test.js (100%) rename {19-MissingAngle => exercises/19-MissingAngle}/README.es.md (100%) rename {19-MissingAngle => exercises/19-MissingAngle}/README.md (100%) rename {19-MissingAngle => exercises/19-MissingAngle}/app.js (100%) rename {19-MissingAngle => exercises/19-MissingAngle}/solution.hide.js (100%) rename {19-MissingAngle => exercises/19-MissingAngle}/test.js (100%) rename {20-NumberLimit => exercises/20-NumberLimit}/README.es.md (100%) rename {20-NumberLimit => exercises/20-NumberLimit}/README.md (100%) rename {20-NumberLimit => exercises/20-NumberLimit}/app.js (100%) rename {20-NumberLimit => exercises/20-NumberLimit}/solution.hide.js (100%) rename {20-NumberLimit => exercises/20-NumberLimit}/test.js (100%) create mode 100644 limitNumValue.js create mode 100644 missingAngle.js diff --git a/AreaOfTriangle.js b/AreaOfTriangle.js new file mode 100644 index 0000000..662900b --- /dev/null +++ b/AreaOfTriangle.js @@ -0,0 +1,6 @@ +function AreaOfTriangle(b, h) { + const result = (b * h) / 2 + console.log(result) +} +AreaOfTriangle(6, 5) + diff --git a/CapitaliseEveryLetter.js b/CapitaliseEveryLetter.js new file mode 100644 index 0000000..227b1e6 --- /dev/null +++ b/CapitaliseEveryLetter.js @@ -0,0 +1,8 @@ +const caps = str => { + str = str.toLowerCase() + .split(' ') + .map((s) => s.charAt(0).toUpperCase() + s.substring(1)) + .join(' ') + console.log(str) +} +caps("javascript is a fantastic language.") \ No newline at end of file diff --git a/CheckNums.js b/CheckNums.js new file mode 100644 index 0000000..c03283a --- /dev/null +++ b/CheckNums.js @@ -0,0 +1,26 @@ +// SOLUTION 1: Using an if...else statement +function CheckNums(num1, num2) { + if (num2 > num1) { + console.log(true) + } else if (num2 === num1) { + console.log(-1) + } else { + console.log(false) + } + } + CheckNums(3, 5) + +// SOLUTION 2: Using a switch statement +function CheckNums(num1, num2) { + switch(true) { + case(num2 > num1): + console.log(true) + break + case(num2 === num1): + console.log(-1) + break + default: + console.log(false) + } + } +CheckNums(3, 5) diff --git a/CompareStrings.js b/CompareStrings.js new file mode 100644 index 0000000..bf4f8cc --- /dev/null +++ b/CompareStrings.js @@ -0,0 +1,10 @@ +function compareStrings(string1, string2) { + if (string1.length === string2.length) { + console.log(true) + } else { + console.log(false) + } +} +compareStrings("Are they the same length?", "No") + + diff --git a/ConcatenateArrays.js b/ConcatenateArrays.js new file mode 100644 index 0000000..6129e92 --- /dev/null +++ b/ConcatenateArrays.js @@ -0,0 +1,7 @@ +function concatenateIntArrays() { +const array1 = [1, 2, 3, 4, 5] +const array2 = [6, 7, 8, 9, 10] +const result = array1.concat(array2) +console.log(result) +} +concatenateIntArrays() \ No newline at end of file diff --git a/DateTime.js b/DateTime.js new file mode 100644 index 0000000..c334290 --- /dev/null +++ b/DateTime.js @@ -0,0 +1,6 @@ +const today = new Date() +const date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate() +const time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds() +const dateTime = date+' '+time +console.log(dateTime) + diff --git a/DivisibleBy5.js b/DivisibleBy5.js new file mode 100644 index 0000000..b9566ef --- /dev/null +++ b/DivisibleBy5.js @@ -0,0 +1,19 @@ + // SOLUTION 1: Is divisible by 5 + function divisibleBy5(int) { + if (int % 5 === 0) { + console.log(true) + } else { + console.log(false) + } + } + divisibleBy5(3) + + + + + // SOLUTION 2: Ternary operator + function divisibleBy5(int) { + const result = int % 5 === 0 ? true : false + console.log(result) + } + divisibleBy5(3) \ No newline at end of file diff --git a/Factorial.js b/Factorial.js new file mode 100644 index 0000000..91b31f7 --- /dev/null +++ b/Factorial.js @@ -0,0 +1,14 @@ +function factorialize(num) { + // Step 1. Create a variable called result to store num + let result = num; + // If num = 0 OR num = 1, the factorial will return 1 + if (num === 0 || num === 1) + return 1; + // Step 2. Create the WHILE loop + while (num > 1) { + num--; // decrements by 1 at each iteration + result *= num; + } + console.log(result); +} +factorialize(5); diff --git a/Fibonacci.js b/Fibonacci.js new file mode 100644 index 0000000..3e1ee27 --- /dev/null +++ b/Fibonacci.js @@ -0,0 +1,11 @@ +// Each num is a sum of the two preceeding numbers +function fib(n) { + + const result = [0, 1]; + for (let i = 2; i < n; i++) { + result.push(result[i-2] + result[i-1]); + } + console.log(result) + + } + fib(8) diff --git a/FizzBuzz.js b/FizzBuzz.js new file mode 100644 index 0000000..3edf3d5 --- /dev/null +++ b/FizzBuzz.js @@ -0,0 +1,29 @@ +// SOLUTION 1: Using if...else statement +for (let i = 0; i < 101; i++) { + if (i % 3 === 0 && i % 5 === 0) { + console.log("FizzBuzz") + } else if (i % 3 === 0) { + console.log("Fizz") + } else if (i % 5 === 0) { + console.log("Buzz") + } else { + console.log(i) + } +} + +// SOLUTION 2: Using switch statement +for (let i = 0; i < 101; i++) { + switch(true) { + case(i % 3 === 0 && i % 5 === 0): + console.log("FizzBuzz") + break + case(i % 3 === 0): + console.log("Fizz") + break + case(i % 5 === 0): + console.log("Buzz") + break + default: + console.log(i) + } +} \ No newline at end of file diff --git a/FormatPhoneNumber.js b/FormatPhoneNumber.js new file mode 100644 index 0000000..bc1772a --- /dev/null +++ b/FormatPhoneNumber.js @@ -0,0 +1,10 @@ +// Create function that takes array of 10 numbers (between 0 and 9) +// & returns string of numbers formatted as phone number +function formatPhoneNumber(numbers) { +const args = Array.prototype.slice.call(arguments); +args.splice(6, 0, "-") +args.splice(2, 0, ") ") +args.splice(0, 0, "(") +console.log(args.join('')) +} +formatPhoneNumber(4, 4, 1, 2, 3, 4, 5, 6, 7, 8) \ No newline at end of file diff --git a/LongestWord.js b/LongestWord.js new file mode 100644 index 0000000..192b17e --- /dev/null +++ b/LongestWord.js @@ -0,0 +1,13 @@ +function longestWord(sen) { + let str = sen.split(" ") + let longest = 0 + sen = null + for (let i = 0; i < str.length - 1; i++) { + if (longest < str[i].length) { + longest = str[i].length + sen = str[i] + } + } + console.log(sen) + } + longestWord("Well, which is the longest word?") \ No newline at end of file diff --git a/MultiplySkip.js b/MultiplySkip.js new file mode 100644 index 0000000..fe7e12b --- /dev/null +++ b/MultiplySkip.js @@ -0,0 +1,18 @@ +// SOLUTION 1: Using switch statement +for (i = 1; i <= 100; i++) { + switch(true) { + case(i % 3 === 0): + continue + case(i % 5 === 0): + console.log(i) + } +} + +// SOLUTION 2: Using if else statement +for (i = 1; i <= 100; i++) { + if (i % 3 === 0) { + continue + } else if (i % 5 === 0) { + console.log(i) + } +} \ No newline at end of file diff --git a/NameChange.js b/NameChange.js new file mode 100644 index 0000000..5eec885 --- /dev/null +++ b/NameChange.js @@ -0,0 +1,18 @@ +// Constructor function +function Person(firstName, lastName) { + this.firstName = firstName + this.lastName = lastName + // change name function + this.changeName = function (name) { + this.lastName = name + } + } + + // Object instance + const person1 = new Person("Sharon", "Goldsworth") + + // changeName() changes last name + person1.changeName("Smith") + + // Print new name + console.log(`Person one is now called ${person1.firstName} ${person1.lastName}.`) diff --git a/Palindrome.js b/Palindrome.js new file mode 100644 index 0000000..fcf99ba --- /dev/null +++ b/Palindrome.js @@ -0,0 +1,7 @@ +const palindrome = str => { + // turn string to lowercase + str = str.toLowerCase() +// split, reverse & join string and print +console.log(str === str.split('').reverse().join('')) +} +palindrome('anna') diff --git a/RemoveChars.js b/RemoveChars.js new file mode 100644 index 0000000..39d38a9 --- /dev/null +++ b/RemoveChars.js @@ -0,0 +1,5 @@ +function removeChars(str) { + const result = str.substring(1, str.length-1) + console.log(result) +} +removeChars("The first and last characters are removed") diff --git a/SplitCake.js b/SplitCake.js new file mode 100644 index 0000000..72e1c1d --- /dev/null +++ b/SplitCake.js @@ -0,0 +1,29 @@ +// SOLUTION 1: Using if statement +const sliceOfCake = (totalSlices, recipients, slicesPerPerson) => { +if (recipients * slicesPerPerson < totalSlices) { + console.log(true) +} else { + console.log(false) +} + } +sliceOfCake(10, 3, 2) + +// SOLUTION 2: Using switch statement +const sliceOfCake = (totalSlices, recipients, slicesPerPerson) => { + switch(true) { + case(recipients * slicesPerPerson < totalSlices): + console.log(true) + break + default: + console.log(false) + } +} +sliceOfCake(10, 3, 2) + +// SOLUTION 3: Using the ternary operator +const sliceOfCake = (totalSlices, recipients, slicesPerPerson) => { + const result = recipients * slicesPerPerson < totalSlices ? true : false + console.log(result) +} +sliceOfCake(10, 3, 2) + diff --git a/VowelCount.js b/VowelCount.js new file mode 100644 index 0000000..eef5d45 --- /dev/null +++ b/VowelCount.js @@ -0,0 +1,7 @@ +const findVowels = str => { +const matched = str.match(/[aeiou]/gi) +console.log(matched ? matched.length : 0) +} +findVowels('vowels') + + diff --git a/01-CheckNums/README.es.md b/exercises/01-CheckNums/README.es.md similarity index 100% rename from 01-CheckNums/README.es.md rename to exercises/01-CheckNums/README.es.md diff --git a/01-CheckNums/README.md b/exercises/01-CheckNums/README.md similarity index 100% rename from 01-CheckNums/README.md rename to exercises/01-CheckNums/README.md diff --git a/01-CheckNums/app.js b/exercises/01-CheckNums/app.js similarity index 100% rename from 01-CheckNums/app.js rename to exercises/01-CheckNums/app.js diff --git a/01-CheckNums/solution.hide.js b/exercises/01-CheckNums/solution.hide.js similarity index 100% rename from 01-CheckNums/solution.hide.js rename to exercises/01-CheckNums/solution.hide.js diff --git a/01-CheckNums/test.js b/exercises/01-CheckNums/test.js similarity index 100% rename from 01-CheckNums/test.js rename to exercises/01-CheckNums/test.js diff --git a/02-CompareStrings/README.es.md b/exercises/02-CompareStrings/README.es.md similarity index 100% rename from 02-CompareStrings/README.es.md rename to exercises/02-CompareStrings/README.es.md diff --git a/02-CompareStrings/README.md b/exercises/02-CompareStrings/README.md similarity index 100% rename from 02-CompareStrings/README.md rename to exercises/02-CompareStrings/README.md diff --git a/02-CompareStrings/app.js b/exercises/02-CompareStrings/app.js similarity index 100% rename from 02-CompareStrings/app.js rename to exercises/02-CompareStrings/app.js diff --git a/02-CompareStrings/solution.hide.js b/exercises/02-CompareStrings/solution.hide.js similarity index 100% rename from 02-CompareStrings/solution.hide.js rename to exercises/02-CompareStrings/solution.hide.js diff --git a/02-CompareStrings/test.js b/exercises/02-CompareStrings/test.js similarity index 100% rename from 02-CompareStrings/test.js rename to exercises/02-CompareStrings/test.js diff --git a/03-ConcatenateArrays/README.es.md b/exercises/03-ConcatenateArrays/README.es.md similarity index 100% rename from 03-ConcatenateArrays/README.es.md rename to exercises/03-ConcatenateArrays/README.es.md diff --git a/03-ConcatenateArrays/README.md b/exercises/03-ConcatenateArrays/README.md similarity index 100% rename from 03-ConcatenateArrays/README.md rename to exercises/03-ConcatenateArrays/README.md diff --git a/03-ConcatenateArrays/app.js b/exercises/03-ConcatenateArrays/app.js similarity index 100% rename from 03-ConcatenateArrays/app.js rename to exercises/03-ConcatenateArrays/app.js diff --git a/03-ConcatenateArrays/solution.hide.js b/exercises/03-ConcatenateArrays/solution.hide.js similarity index 100% rename from 03-ConcatenateArrays/solution.hide.js rename to exercises/03-ConcatenateArrays/solution.hide.js diff --git a/03-ConcatenateArrays/test.js b/exercises/03-ConcatenateArrays/test.js similarity index 100% rename from 03-ConcatenateArrays/test.js rename to exercises/03-ConcatenateArrays/test.js diff --git a/04-VowelCount/README.es.md b/exercises/04-VowelCount/README.es.md similarity index 100% rename from 04-VowelCount/README.es.md rename to exercises/04-VowelCount/README.es.md diff --git a/04-VowelCount/README.md b/exercises/04-VowelCount/README.md similarity index 100% rename from 04-VowelCount/README.md rename to exercises/04-VowelCount/README.md diff --git a/04-VowelCount/app.js b/exercises/04-VowelCount/app.js similarity index 100% rename from 04-VowelCount/app.js rename to exercises/04-VowelCount/app.js diff --git a/04-VowelCount/solution.hide.js b/exercises/04-VowelCount/solution.hide.js similarity index 100% rename from 04-VowelCount/solution.hide.js rename to exercises/04-VowelCount/solution.hide.js diff --git a/04-VowelCount/test.js b/exercises/04-VowelCount/test.js similarity index 100% rename from 04-VowelCount/test.js rename to exercises/04-VowelCount/test.js diff --git a/05-DateTime/README.es.md b/exercises/05-DateTime/README.es.md similarity index 100% rename from 05-DateTime/README.es.md rename to exercises/05-DateTime/README.es.md diff --git a/05-DateTime/README.md b/exercises/05-DateTime/README.md similarity index 100% rename from 05-DateTime/README.md rename to exercises/05-DateTime/README.md diff --git a/05-DateTime/app.js b/exercises/05-DateTime/app.js similarity index 100% rename from 05-DateTime/app.js rename to exercises/05-DateTime/app.js diff --git a/05-DateTime/solution.hide.js b/exercises/05-DateTime/solution.hide.js similarity index 100% rename from 05-DateTime/solution.hide.js rename to exercises/05-DateTime/solution.hide.js diff --git a/05-DateTime/test.js b/exercises/05-DateTime/test.js similarity index 100% rename from 05-DateTime/test.js rename to exercises/05-DateTime/test.js diff --git a/06-DivisibleBy5/README.es.md b/exercises/06-DivisibleBy5/README.es.md similarity index 100% rename from 06-DivisibleBy5/README.es.md rename to exercises/06-DivisibleBy5/README.es.md diff --git a/06-DivisibleBy5/README.md b/exercises/06-DivisibleBy5/README.md similarity index 100% rename from 06-DivisibleBy5/README.md rename to exercises/06-DivisibleBy5/README.md diff --git a/06-DivisibleBy5/app.js b/exercises/06-DivisibleBy5/app.js similarity index 100% rename from 06-DivisibleBy5/app.js rename to exercises/06-DivisibleBy5/app.js diff --git a/06-DivisibleBy5/solution.hide.js b/exercises/06-DivisibleBy5/solution.hide.js similarity index 100% rename from 06-DivisibleBy5/solution.hide.js rename to exercises/06-DivisibleBy5/solution.hide.js diff --git a/06-DivisibleBy5/test.js b/exercises/06-DivisibleBy5/test.js similarity index 100% rename from 06-DivisibleBy5/test.js rename to exercises/06-DivisibleBy5/test.js diff --git a/07-Factorial/README.es.md b/exercises/07-Factorial/README.es.md similarity index 100% rename from 07-Factorial/README.es.md rename to exercises/07-Factorial/README.es.md diff --git a/07-Factorial/README.md b/exercises/07-Factorial/README.md similarity index 100% rename from 07-Factorial/README.md rename to exercises/07-Factorial/README.md diff --git a/07-Factorial/app.js b/exercises/07-Factorial/app.js similarity index 100% rename from 07-Factorial/app.js rename to exercises/07-Factorial/app.js diff --git a/07-Factorial/solution.hide.js b/exercises/07-Factorial/solution.hide.js similarity index 100% rename from 07-Factorial/solution.hide.js rename to exercises/07-Factorial/solution.hide.js diff --git a/07-Factorial/test.js b/exercises/07-Factorial/test.js similarity index 100% rename from 07-Factorial/test.js rename to exercises/07-Factorial/test.js diff --git a/08-Fibonacci/README.es.md b/exercises/08-Fibonacci/README.es.md similarity index 100% rename from 08-Fibonacci/README.es.md rename to exercises/08-Fibonacci/README.es.md diff --git a/08-Fibonacci/README.md b/exercises/08-Fibonacci/README.md similarity index 100% rename from 08-Fibonacci/README.md rename to exercises/08-Fibonacci/README.md diff --git a/08-Fibonacci/app.js b/exercises/08-Fibonacci/app.js similarity index 100% rename from 08-Fibonacci/app.js rename to exercises/08-Fibonacci/app.js diff --git a/08-Fibonacci/solution.hide.js b/exercises/08-Fibonacci/solution.hide.js similarity index 100% rename from 08-Fibonacci/solution.hide.js rename to exercises/08-Fibonacci/solution.hide.js diff --git a/08-Fibonacci/test.js b/exercises/08-Fibonacci/test.js similarity index 100% rename from 08-Fibonacci/test.js rename to exercises/08-Fibonacci/test.js diff --git a/09-FizzBuzz/README.es.md b/exercises/09-FizzBuzz/README.es.md similarity index 100% rename from 09-FizzBuzz/README.es.md rename to exercises/09-FizzBuzz/README.es.md diff --git a/09-FizzBuzz/README.md b/exercises/09-FizzBuzz/README.md similarity index 100% rename from 09-FizzBuzz/README.md rename to exercises/09-FizzBuzz/README.md diff --git a/09-FizzBuzz/app.js b/exercises/09-FizzBuzz/app.js similarity index 100% rename from 09-FizzBuzz/app.js rename to exercises/09-FizzBuzz/app.js diff --git a/09-FizzBuzz/solution.hide.js b/exercises/09-FizzBuzz/solution.hide.js similarity index 100% rename from 09-FizzBuzz/solution.hide.js rename to exercises/09-FizzBuzz/solution.hide.js diff --git a/09-FizzBuzz/test.js b/exercises/09-FizzBuzz/test.js similarity index 100% rename from 09-FizzBuzz/test.js rename to exercises/09-FizzBuzz/test.js diff --git a/10-CapitaliseLetters/README.es.md b/exercises/10-CapitaliseLetters/README.es.md similarity index 100% rename from 10-CapitaliseLetters/README.es.md rename to exercises/10-CapitaliseLetters/README.es.md diff --git a/10-CapitaliseLetters/README.md b/exercises/10-CapitaliseLetters/README.md similarity index 100% rename from 10-CapitaliseLetters/README.md rename to exercises/10-CapitaliseLetters/README.md diff --git a/10-CapitaliseLetters/app.js b/exercises/10-CapitaliseLetters/app.js similarity index 100% rename from 10-CapitaliseLetters/app.js rename to exercises/10-CapitaliseLetters/app.js diff --git a/10-CapitaliseLetters/solution.hide.js b/exercises/10-CapitaliseLetters/solution.hide.js similarity index 100% rename from 10-CapitaliseLetters/solution.hide.js rename to exercises/10-CapitaliseLetters/solution.hide.js diff --git a/10-CapitaliseLetters/test.js b/exercises/10-CapitaliseLetters/test.js similarity index 100% rename from 10-CapitaliseLetters/test.js rename to exercises/10-CapitaliseLetters/test.js diff --git a/11-MultiplyAndSkip/README.es.md b/exercises/11-MultiplyAndSkip/README.es.md similarity index 100% rename from 11-MultiplyAndSkip/README.es.md rename to exercises/11-MultiplyAndSkip/README.es.md diff --git a/11-MultiplyAndSkip/README.md b/exercises/11-MultiplyAndSkip/README.md similarity index 100% rename from 11-MultiplyAndSkip/README.md rename to exercises/11-MultiplyAndSkip/README.md diff --git a/11-MultiplyAndSkip/app.js b/exercises/11-MultiplyAndSkip/app.js similarity index 100% rename from 11-MultiplyAndSkip/app.js rename to exercises/11-MultiplyAndSkip/app.js diff --git a/11-MultiplyAndSkip/solution.hide.js b/exercises/11-MultiplyAndSkip/solution.hide.js similarity index 100% rename from 11-MultiplyAndSkip/solution.hide.js rename to exercises/11-MultiplyAndSkip/solution.hide.js diff --git a/11-MultiplyAndSkip/test.js b/exercises/11-MultiplyAndSkip/test.js similarity index 100% rename from 11-MultiplyAndSkip/test.js rename to exercises/11-MultiplyAndSkip/test.js diff --git a/12-NameChange/README.es.md b/exercises/12-NameChange/README.es.md similarity index 100% rename from 12-NameChange/README.es.md rename to exercises/12-NameChange/README.es.md diff --git a/12-NameChange/README.md b/exercises/12-NameChange/README.md similarity index 100% rename from 12-NameChange/README.md rename to exercises/12-NameChange/README.md diff --git a/12-NameChange/app.js b/exercises/12-NameChange/app.js similarity index 100% rename from 12-NameChange/app.js rename to exercises/12-NameChange/app.js diff --git a/12-NameChange/solution.hide.js b/exercises/12-NameChange/solution.hide.js similarity index 100% rename from 12-NameChange/solution.hide.js rename to exercises/12-NameChange/solution.hide.js diff --git a/12-NameChange/test.js b/exercises/12-NameChange/test.js similarity index 100% rename from 12-NameChange/test.js rename to exercises/12-NameChange/test.js diff --git a/13-Palindrome/README.es.md b/exercises/13-Palindrome/README.es.md similarity index 100% rename from 13-Palindrome/README.es.md rename to exercises/13-Palindrome/README.es.md diff --git a/13-Palindrome/README.md b/exercises/13-Palindrome/README.md similarity index 100% rename from 13-Palindrome/README.md rename to exercises/13-Palindrome/README.md diff --git a/13-Palindrome/app.js b/exercises/13-Palindrome/app.js similarity index 100% rename from 13-Palindrome/app.js rename to exercises/13-Palindrome/app.js diff --git a/13-Palindrome/solution.hide.js b/exercises/13-Palindrome/solution.hide.js similarity index 100% rename from 13-Palindrome/solution.hide.js rename to exercises/13-Palindrome/solution.hide.js diff --git a/13-Palindrome/test.js b/exercises/13-Palindrome/test.js similarity index 100% rename from 13-Palindrome/test.js rename to exercises/13-Palindrome/test.js diff --git a/14-RemoveCharacters/README.es.md b/exercises/14-RemoveCharacters/README.es.md similarity index 100% rename from 14-RemoveCharacters/README.es.md rename to exercises/14-RemoveCharacters/README.es.md diff --git a/14-RemoveCharacters/README.md b/exercises/14-RemoveCharacters/README.md similarity index 100% rename from 14-RemoveCharacters/README.md rename to exercises/14-RemoveCharacters/README.md diff --git a/14-RemoveCharacters/app.js b/exercises/14-RemoveCharacters/app.js similarity index 100% rename from 14-RemoveCharacters/app.js rename to exercises/14-RemoveCharacters/app.js diff --git a/14-RemoveCharacters/solution.hide.js b/exercises/14-RemoveCharacters/solution.hide.js similarity index 100% rename from 14-RemoveCharacters/solution.hide.js rename to exercises/14-RemoveCharacters/solution.hide.js diff --git a/14-RemoveCharacters/test.js b/exercises/14-RemoveCharacters/test.js similarity index 100% rename from 14-RemoveCharacters/test.js rename to exercises/14-RemoveCharacters/test.js diff --git a/15-ShareCake/README.es.md b/exercises/15-ShareCake/README.es.md similarity index 100% rename from 15-ShareCake/README.es.md rename to exercises/15-ShareCake/README.es.md diff --git a/15-ShareCake/README.md b/exercises/15-ShareCake/README.md similarity index 100% rename from 15-ShareCake/README.md rename to exercises/15-ShareCake/README.md diff --git a/15-ShareCake/app.js b/exercises/15-ShareCake/app.js similarity index 100% rename from 15-ShareCake/app.js rename to exercises/15-ShareCake/app.js diff --git a/15-ShareCake/solution.hide.js b/exercises/15-ShareCake/solution.hide.js similarity index 100% rename from 15-ShareCake/solution.hide.js rename to exercises/15-ShareCake/solution.hide.js diff --git a/15-ShareCake/test.js b/exercises/15-ShareCake/test.js similarity index 100% rename from 15-ShareCake/test.js rename to exercises/15-ShareCake/test.js diff --git a/16-FormatPhoneNumber/README.es.md b/exercises/16-FormatPhoneNumber/README.es.md similarity index 100% rename from 16-FormatPhoneNumber/README.es.md rename to exercises/16-FormatPhoneNumber/README.es.md diff --git a/16-FormatPhoneNumber/README.md b/exercises/16-FormatPhoneNumber/README.md similarity index 100% rename from 16-FormatPhoneNumber/README.md rename to exercises/16-FormatPhoneNumber/README.md diff --git a/16-FormatPhoneNumber/app.js b/exercises/16-FormatPhoneNumber/app.js similarity index 100% rename from 16-FormatPhoneNumber/app.js rename to exercises/16-FormatPhoneNumber/app.js diff --git a/16-FormatPhoneNumber/solution.hide.js b/exercises/16-FormatPhoneNumber/solution.hide.js similarity index 100% rename from 16-FormatPhoneNumber/solution.hide.js rename to exercises/16-FormatPhoneNumber/solution.hide.js diff --git a/16-FormatPhoneNumber/test.js b/exercises/16-FormatPhoneNumber/test.js similarity index 100% rename from 16-FormatPhoneNumber/test.js rename to exercises/16-FormatPhoneNumber/test.js diff --git a/17-AreaOfTriangle/README.es.md b/exercises/17-AreaOfTriangle/README.es.md similarity index 100% rename from 17-AreaOfTriangle/README.es.md rename to exercises/17-AreaOfTriangle/README.es.md diff --git a/17-AreaOfTriangle/README.md b/exercises/17-AreaOfTriangle/README.md similarity index 100% rename from 17-AreaOfTriangle/README.md rename to exercises/17-AreaOfTriangle/README.md diff --git a/17-AreaOfTriangle/app.js b/exercises/17-AreaOfTriangle/app.js similarity index 100% rename from 17-AreaOfTriangle/app.js rename to exercises/17-AreaOfTriangle/app.js diff --git a/17-AreaOfTriangle/solution.hide.js b/exercises/17-AreaOfTriangle/solution.hide.js similarity index 100% rename from 17-AreaOfTriangle/solution.hide.js rename to exercises/17-AreaOfTriangle/solution.hide.js diff --git a/17-AreaOfTriangle/test.js b/exercises/17-AreaOfTriangle/test.js similarity index 100% rename from 17-AreaOfTriangle/test.js rename to exercises/17-AreaOfTriangle/test.js diff --git a/18-LongestWord/README.es.md b/exercises/18-LongestWord/README.es.md similarity index 100% rename from 18-LongestWord/README.es.md rename to exercises/18-LongestWord/README.es.md diff --git a/18-LongestWord/README.md b/exercises/18-LongestWord/README.md similarity index 100% rename from 18-LongestWord/README.md rename to exercises/18-LongestWord/README.md diff --git a/18-LongestWord/app.js b/exercises/18-LongestWord/app.js similarity index 100% rename from 18-LongestWord/app.js rename to exercises/18-LongestWord/app.js diff --git a/18-LongestWord/solution.hide.js b/exercises/18-LongestWord/solution.hide.js similarity index 100% rename from 18-LongestWord/solution.hide.js rename to exercises/18-LongestWord/solution.hide.js diff --git a/18-LongestWord/test.js b/exercises/18-LongestWord/test.js similarity index 100% rename from 18-LongestWord/test.js rename to exercises/18-LongestWord/test.js diff --git a/19-MissingAngle/README.es.md b/exercises/19-MissingAngle/README.es.md similarity index 100% rename from 19-MissingAngle/README.es.md rename to exercises/19-MissingAngle/README.es.md diff --git a/19-MissingAngle/README.md b/exercises/19-MissingAngle/README.md similarity index 100% rename from 19-MissingAngle/README.md rename to exercises/19-MissingAngle/README.md diff --git a/19-MissingAngle/app.js b/exercises/19-MissingAngle/app.js similarity index 100% rename from 19-MissingAngle/app.js rename to exercises/19-MissingAngle/app.js diff --git a/19-MissingAngle/solution.hide.js b/exercises/19-MissingAngle/solution.hide.js similarity index 100% rename from 19-MissingAngle/solution.hide.js rename to exercises/19-MissingAngle/solution.hide.js diff --git a/19-MissingAngle/test.js b/exercises/19-MissingAngle/test.js similarity index 100% rename from 19-MissingAngle/test.js rename to exercises/19-MissingAngle/test.js diff --git a/20-NumberLimit/README.es.md b/exercises/20-NumberLimit/README.es.md similarity index 100% rename from 20-NumberLimit/README.es.md rename to exercises/20-NumberLimit/README.es.md diff --git a/20-NumberLimit/README.md b/exercises/20-NumberLimit/README.md similarity index 100% rename from 20-NumberLimit/README.md rename to exercises/20-NumberLimit/README.md diff --git a/20-NumberLimit/app.js b/exercises/20-NumberLimit/app.js similarity index 100% rename from 20-NumberLimit/app.js rename to exercises/20-NumberLimit/app.js diff --git a/20-NumberLimit/solution.hide.js b/exercises/20-NumberLimit/solution.hide.js similarity index 100% rename from 20-NumberLimit/solution.hide.js rename to exercises/20-NumberLimit/solution.hide.js diff --git a/20-NumberLimit/test.js b/exercises/20-NumberLimit/test.js similarity index 100% rename from 20-NumberLimit/test.js rename to exercises/20-NumberLimit/test.js diff --git a/learn.json b/learn.json index 5eec39a..bda7339 100644 --- a/learn.json +++ b/learn.json @@ -5,7 +5,7 @@ "publicPath": "/preview", "language": "auto", "grading": "isolated", - "exercisesPath": "./", + "exercisesPath": "./exercises", "disableGrading": false, "disabledActions": [], "actions": [], diff --git a/limitNumValue.js b/limitNumValue.js new file mode 100644 index 0000000..adbd6a8 --- /dev/null +++ b/limitNumValue.js @@ -0,0 +1,14 @@ +const numLimit = (num, lowest, highest) => { +switch(true) { + case(num >= lowest && num <= highest): + console.log(num) + break + case(num < lowest): + console.log(lowest) + break + case(num > highest): + console.log(highest) + break +} +} +numLimit(5, 10, 20) \ No newline at end of file diff --git a/missingAngle.js b/missingAngle.js new file mode 100644 index 0000000..216102c --- /dev/null +++ b/missingAngle.js @@ -0,0 +1,15 @@ +const missingAngle = (degree1, degree2) => { + const result = 180 - (degree1 + degree2) +switch(true) { + case(result < 90): + console.log('Acute') + break + case(result === 90): + console.log('Right') + break + case(result >= 90): + console.log('Obtuse') + break +} +} +missingAngle(7, 93) From 2db8150b49882ccc9e514af01375ceb68f74cc44 Mon Sep 17 00:00:00 2001 From: ErnestoXG Date: Mon, 11 Jul 2022 21:12:42 +0000 Subject: [PATCH 28/28] fixed errors in readme --- exercises/02-CompareStrings/README.es.md | 2 +- exercises/02-CompareStrings/README.md | 2 +- exercises/06-DivisibleBy5/README.es.md | 2 +- exercises/20-NumberLimit/README.md | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/exercises/02-CompareStrings/README.es.md b/exercises/02-CompareStrings/README.es.md index d074289..13696ef 100644 --- a/exercises/02-CompareStrings/README.es.md +++ b/exercises/02-CompareStrings/README.es.md @@ -1,4 +1,4 @@ -# `02` Comapre Strings +# `02` Compare Strings Crea una funcion `compareStrings` que toma dos strings como argumentos. diff --git a/exercises/02-CompareStrings/README.md b/exercises/02-CompareStrings/README.md index 6f086ec..3b1a74a 100644 --- a/exercises/02-CompareStrings/README.md +++ b/exercises/02-CompareStrings/README.md @@ -1,4 +1,4 @@ -# `02` Comapre Strings +# `02` Compare Strings Create a function `compareStrings` that takes two strings as arguments. diff --git a/exercises/06-DivisibleBy5/README.es.md b/exercises/06-DivisibleBy5/README.es.md index d94a207..fb38dba 100644 --- a/exercises/06-DivisibleBy5/README.es.md +++ b/exercises/06-DivisibleBy5/README.es.md @@ -1,4 +1,4 @@ # `06` Divisible By 5 ## Instrucciones 🗒 -1. Crea una función que retorne `true` si un integral es dividido por `5`, y `false` si no lo es. \ No newline at end of file +1. Crea una función que retorne `true` si un integral es divisible por `5`, y `false` si no lo es. \ No newline at end of file diff --git a/exercises/20-NumberLimit/README.md b/exercises/20-NumberLimit/README.md index 2509d9a..27b3dbc 100644 --- a/exercises/20-NumberLimit/README.md +++ b/exercises/20-NumberLimit/README.md @@ -3,4 +3,4 @@ 1. Write a function `numLimit` which takes three number arguments (one number as an input and the other two numbers representing the lowest and highest points of the range). 2. If the number falls within the range, `return` the number. 3. If the number is less than the lower limit of the range, `return` the lowest limit number. -4. Ff the number is greater than the upper limit of the range, `return` the highest limit number. \ No newline at end of file +4. If the number is greater than the upper limit of the range, `return` the highest limit number. \ No newline at end of file