From 048bb5b333a1e436606cbb2fa21c533a6064a420 Mon Sep 17 00:00:00 2001 From: 0xHirooo Date: Thu, 16 Mar 2023 23:15:47 -0300 Subject: [PATCH 1/2] tasks completados --- PULL_REQUEST_TEMPLATE.md | 2 +- src/factorial.js | 5 +++++ src/fibonacci.js | 5 +++++ src/primalidad.js | 11 +++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 2449150..23aa83d 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,7 +1,7 @@ ## DESCRIPTION Nombre: -Usuario Platzi: +Usuario Platzi:Haiiro ## Reto: diff --git a/src/factorial.js b/src/factorial.js index 4f3ae70..97147b6 100644 --- a/src/factorial.js +++ b/src/factorial.js @@ -1,5 +1,10 @@ const factorial = (number) => { // your code here + let t = 1; + for(i = 1; i<= number; i++){ + t = t * i; + } + return t; } module.exports = factorial; \ No newline at end of file diff --git a/src/fibonacci.js b/src/fibonacci.js index ea3270f..1d72bcf 100644 --- a/src/fibonacci.js +++ b/src/fibonacci.js @@ -1,5 +1,10 @@ const fibonacci = (n) => { // your code here + let Arr = [0, 1]; + for (let i = 2; i < n; i++) { + Arr[i] = Arr[i - 1] + Arr[i - 2]; + } + return Arr; } module.exports = fibonacci; \ No newline at end of file diff --git a/src/primalidad.js b/src/primalidad.js index 8bdb849..2047759 100644 --- a/src/primalidad.js +++ b/src/primalidad.js @@ -1,5 +1,16 @@ const trialDivision = (number) => { // your code here + function pri(trialDivision){ + for (let i = 2; i < numero; i++) { + if(number % i === 1){ + return true; + } + else{ + return false; + } + } + } + } module.exports = trialDivision; \ No newline at end of file From fdd8a8c60b0c38b78d5ccbd1bfc0dd267bbeeafc Mon Sep 17 00:00:00 2001 From: 0xHirooo Date: Thu, 16 Mar 2023 23:22:42 -0300 Subject: [PATCH 2/2] tarea completada --- PULL_REQUEST_TEMPLATE.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PULL_REQUEST_TEMPLATE.md b/PULL_REQUEST_TEMPLATE.md index 23aa83d..30cac47 100644 --- a/PULL_REQUEST_TEMPLATE.md +++ b/PULL_REQUEST_TEMPLATE.md @@ -1,10 +1,10 @@ ## DESCRIPTION -Nombre: +Nombre:Hiroki Kondo Nishioeda Usuario Platzi:Haiiro ## Reto: -- [ ] Primer problema -- [ ] Segundo problema -- [ ] Tercer problema +- [Hecho] Primer problema +- [Hecho] Segundo problema +- [Hecho] Tercer problema