From 0cf4e987beb8afb4a03b7e925cf1d67a71545457 Mon Sep 17 00:00:00 2001 From: Leandro Balaguer Date: Tue, 9 Aug 2022 21:50:56 +0200 Subject: [PATCH 1/7] done! --- .DS_Store | Bin 0 -> 6148 bytes js/index.js | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..96c15245feae7bed99b97b5d3c4118b69e23eb4b GIT binary patch literal 6148 zcmeHKy-ve05I(mB5+S4xATe5Et)LVTLM)-Q0|N^|FaRnIsUQ&Is%hy^Rmuzx!^)HJ zI&f#Zi1IUnD7ur*-<^Hu#9tzx4FICr3s(V(0N|h!=3H#P5E>`_BstqtKom4b5UT)f znrz38G5l=?=-cJs8q&R3U3~a{%P(5=0(4B!Pun);DQL%0+AWu#MJ`{Mnx1iHoLT40 zzfyg_+wAtzYO`}f-l0-)FtVG$QPk=;iu1cF={BRJ)zJx2*us$0<0uJLzp8pknCe{L z3^=aiHj0ab!A7N0l53k=!;&0qRmvr~zEK$tU1wowW&5CU6W=E4-q0=Zf7CK(aRd)& z=(XJWog`MtCHfTW!U5FrudTs8;xgPq_<@l}jC#)qx-859Gr$Z?C^?{rR<- z0cPOm7@++@q7r%*GlP2Tz(!vI5a}4H1#LS1Q;xLgSo-iZPZ-@gk}g?3ZL9dKNQ-*n`3c0Zjup%)qZQ F@CtIcUE2Tv literal 0 HcmV?d00001 diff --git a/js/index.js b/js/index.js index 59e4af7fb..de4e937d4 100644 --- a/js/index.js +++ b/js/index.js @@ -1,6 +1,23 @@ // Iteration 1: Names and Input +console.log("I´m ready!") + +let hacker1 = "Jack" +console.log("The driver´s name is: ", hacker1) + +let hacker2 = "Bob" +console.log("The navigator's name is:", hacker2) // // Iteration 2: Conditionals +console.log(hacker1.length) +console.log(hacker2.length) + +console.log("Looks like", hacker1, "has the longest name with", hacker1.length, "characters. Well donde fckr!") // Iteration 3: Loops + +console.log(hacker1.toUpperCase()) + +console.log(hacker1.split("").reverse().join("")) + +// Iteration 4: Loops \ No newline at end of file From 6ac5a189f8ad46b68eef73373ab5791330589885 Mon Sep 17 00:00:00 2001 From: Leandro Balaguer Date: Thu, 11 Aug 2022 22:11:55 +0200 Subject: [PATCH 2/7] Update index.js --- js/index.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/js/index.js b/js/index.js index de4e937d4..ee00dc5e3 100644 --- a/js/index.js +++ b/js/index.js @@ -7,17 +7,35 @@ console.log("The driver´s name is: ", hacker1) let hacker2 = "Bob" console.log("The navigator's name is:", hacker2) // -// Iteration 2: Conditionals +// Iteration 2.1: Conditionals console.log(hacker1.length) console.log(hacker2.length) -console.log("Looks like", hacker1, "has the longest name with", hacker1.length, "characters. Well donde fckr!") +console.log("Looks like", hacker1, "has the longest name with", hacker1.length, "characters. Well done!") // Iteration 3: Loops -console.log(hacker1.toUpperCase()) +// 3.1 +console.log(hacker1.toUpperCase().split('').join(' ')) +// 3.2 console.log(hacker1.split("").reverse().join("")) -// Iteration 4: Loops \ No newline at end of file +// 3.3 + +let names= [hacker1, hacker2] +console.log(names.sort()); + +let drivers = ["Jack", "Bob"]; +drivers.sort((a, b) => { + if (a == b) { + console.log("What?! You both have the same name?") + } + if (a < b) { + console.log("Yo, the navigator goes first definitely.") + } + if (a > b) { + console.log("The driver's name goes first.") +} +}); From 0f4e4042f2280db36a3d2c1a5b0e1fa459f11bf1 Mon Sep 17 00:00:00 2001 From: Leandro Balaguer Date: Thu, 25 Aug 2022 01:34:08 +0200 Subject: [PATCH 3/7] 220825_Update --- .DS_Store | Bin 6148 -> 8196 bytes js/index.js | 79 +++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 59 insertions(+), 20 deletions(-) diff --git a/.DS_Store b/.DS_Store index 96c15245feae7bed99b97b5d3c4118b69e23eb4b..aad4d751807d432def50c532964ef2f39bb703ab 100644 GIT binary patch literal 8196 zcmeHMTWl0n824Lu7tuBg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index.js index ee00dc5e3..1db0d42fb 100644 --- a/js/index.js +++ b/js/index.js @@ -1,41 +1,80 @@ // Iteration 1: Names and Input console.log("I´m ready!") -let hacker1 = "Jack" -console.log("The driver´s name is: ", hacker1) -let hacker2 = "Bob" -console.log("The navigator's name is:", hacker2) -// -// Iteration 2.1: Conditionals +//1.1 +const hacker1 = "Jack" + +//1.2 +console.log(`The driver´s name is: ${hacker1}`) +//1.3 + +const hacker2 = "Bob" -console.log(hacker1.length) -console.log(hacker2.length) +//1.4 +console.log(`The navigator´s name is: ${hacker2}`) -console.log("Looks like", hacker1, "has the longest name with", hacker1.length, "characters. Well done!") +// Iteration 2: Conditionals +// Iteration 2.1: Conditionals + +if (hacker1.length > hacker2.length) { + console.log(`The driver has the longest name, it has: ${hacker1.length} characters.`); +} + else if (hacker1.length < hacker2.length) { + console.log(`It seems that the navigator has the longest name, it has: ${hacker2.length} characters.`); +} + else if (hacker1.length === hacker2.length) { + console.log(`Wow, you both have equally long names with ${hacker2.length} characters!.`); +} // Iteration 3: Loops -// 3.1 -console.log(hacker1.toUpperCase().split('').join(' ')) +//3.1 + +const goUp = hacker1; +for (const value of goUp) { + let result = value.toUpperCase(); + console.log(result); +} // 3.2 console.log(hacker1.split("").reverse().join("")) // 3.3 -let names= [hacker1, hacker2] -console.log(names.sort()); - -let drivers = ["Jack", "Bob"]; -drivers.sort((a, b) => { - if (a == b) { + if (hacker1 == hacker2) { console.log("What?! You both have the same name?") } - if (a < b) { + else if (hacker2 < hacker1) { console.log("Yo, the navigator goes first definitely.") } - if (a > b) { + else if (hacker2 > hacker1) { console.log("The driver's name goes first.") } -}); + + +//Bonus 1: + +const lorem = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras fringilla libero pharetra efficitur porta. Ut tellus lacus, iaculis ut varius a, accumsan id sapien. Fusce auctor at tellus eget imperdiet. Vivamus molestie lobortis ligula, vel fringilla nibh ultrices viverra. Maecenas at ligula ut arcu euismod semper. Praesent accumsan quam vel tortor viverra fermentum. Maecenas pretium vel mauris vel fringilla. Nam et augue vel nisi venenatis viverra interdum vel leo. Ut tempor commodo ipsum sed auctor.Nam aliquam porta tortor, ut commodo nunc. Nunc id rhoncus orci. Ut eu mi ipsum. Fusce sit amet ex eu risus pretium auctor. Quisque porttitor leo nisi, non convallis nibh bibendum ut. Phasellus ut metus ac arcu viverra fermentum. Quisque et tempor sapien, et scelerisque mi.Praesent porttitor luctus imperdiet. Fusce et venenatis erat. Aliquam vel porttitor magna, cursus tincidunt velit. Aenean sit amet arcu quis risus pretium fringilla. Vestibulum elementum ipsum id ligula consectetur, ut blandit neque malesuada. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Nullam ac sapien tincidunt, imperdiet purus sed, iaculis dui."; + +//console.log(lorem.split(" ")); + +//let countWords = lorem.split(' ').length; +//console.log("El numero total de palabras es: " + countWords ); + +//Bonus 1.2 + +function countWords(lorem) { +let count = 0; +for (let i= 0; i <= lorem.length; i++) { + if (lorem.charAt(i) == " ") { + count ++; + } +} +return count + 1; +} +console.log("The number of words in the string are: " + countWords(lorem)); + +//Bonus 1.3 + + From ff1dc615d53d8effedecffba3693ad1883130df2 Mon Sep 17 00:00:00 2001 From: Leandro Balaguer Date: Thu, 25 Aug 2022 17:59:10 +0200 Subject: [PATCH 4/7] Update index.js --- js/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/index.js b/js/index.js index 1db0d42fb..c677aff59 100644 --- a/js/index.js +++ b/js/index.js @@ -6,22 +6,22 @@ console.log("I´m ready!") const hacker1 = "Jack" //1.2 -console.log(`The driver´s name is: ${hacker1}`) +console.log("The driver´s name is:" + hacker1) //1.3 const hacker2 = "Bob" //1.4 -console.log(`The navigator´s name is: ${hacker2}`) +console.log("The navigator´s name is:" +hacker2) // Iteration 2: Conditionals // Iteration 2.1: Conditionals if (hacker1.length > hacker2.length) { - console.log(`The driver has the longest name, it has: ${hacker1.length} characters.`); + console.log("The driver has the longest name, it has: " + hacker1.length + " " + "characters."); } else if (hacker1.length < hacker2.length) { - console.log(`It seems that the navigator has the longest name, it has: ${hacker2.length} characters.`); + console.log("It seems that the navigator has the longest name, it has: " + hacker2.length + " " + "characters."); } else if (hacker1.length === hacker2.length) { console.log(`Wow, you both have equally long names with ${hacker2.length} characters!.`); @@ -34,6 +34,7 @@ if (hacker1.length > hacker2.length) { const goUp = hacker1; for (const value of goUp) { let result = value.toUpperCase(); +// let final = result.split().join(" "); console.log(result); } From e96fbc4e590a8f6dcd88394fc0079a60ec9fc6fc Mon Sep 17 00:00:00 2001 From: Leandro Balaguer Date: Thu, 25 Aug 2022 22:13:25 +0200 Subject: [PATCH 5/7] Update 250822 --- js/index.js | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/js/index.js b/js/index.js index c677aff59..0520cc2dd 100644 --- a/js/index.js +++ b/js/index.js @@ -23,7 +23,7 @@ if (hacker1.length > hacker2.length) { else if (hacker1.length < hacker2.length) { console.log("It seems that the navigator has the longest name, it has: " + hacker2.length + " " + "characters."); } - else if (hacker1.length === hacker2.length) { + else { console.log(`Wow, you both have equally long names with ${hacker2.length} characters!.`); } @@ -31,15 +31,32 @@ if (hacker1.length > hacker2.length) { //3.1 -const goUp = hacker1; +/*const goUp = hacker1; for (const value of goUp) { let result = value.toUpperCase(); -// let final = result.split().join(" "); - console.log(result); + let final = result.split().join(" "); } +console.log(final); +*/ + +let goUp = ""; + for (let i = 0; i < hacker1.length; i++) { + goUp += hacker1[i].toUpperCase() + " "; +} +console.log(goUp.trim()); + +//console.log(hacker1.toUpperCase().split("").join(" ")); // 3.2 -console.log(hacker1.split("").reverse().join("")) +let goBack = ""; + for (let i = hacker1.length -1; i >= 0; i--) { + goBack += hacker1[i]; +} +console.log(goBack); + +//console.log(hacker1.toUpperCase().split("").join(" ")); + +//console.log(hacker1.split("").reverse().join("")) // 3.3 @@ -77,5 +94,3 @@ return count + 1; console.log("The number of words in the string are: " + countWords(lorem)); //Bonus 1.3 - - From cf4a01aeaea380de0b266460998f8e11f2508b00 Mon Sep 17 00:00:00 2001 From: Leandro Balaguer Date: Sat, 3 Sep 2022 17:01:26 +0200 Subject: [PATCH 6/7] Delete .DS_Store --- .DS_Store | Bin 8196 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index aad4d751807d432def50c532964ef2f39bb703ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8196 zcmeHMTWl0n824Lu7tuBgDVCKcap~fyF`HV0);zZaQVPsWDIU7=#NhQ$9!|Zgut*2 zBM?U5#t87cdj#$Wx7%{kOYZNrSN!BV`8KI3cOtM^Oifs(>&4?=VI(iVpm2pGDUz~E zIng)fO!ax1mv!5;%rV|Nta)Rppx*B|*44U}8Z?cmBr9!qY)><7BjY=pxomddv5Z0SBZK67^V z+}wjNi6vw3+JNFEA$U2re#@O~7i){Wm|NS|xwXm4O11kykCJ4oCuz!uCOp%z-9aPc z5++%(OUvv|JNDs>!SzFF$I6b|ZjzOxH7lL9G|yQ>s^OR|1WVxhZL%*$!8<+1aD`#qjx-RD>Y_IuBtWp}zrpz;0)0+`v zsIiT*#NIlt(=2)&o%g8w8dZ&Lk)&f>-kve26kTTFS5jQDYN{dWI%NGy`GFy^>slHN$CVe4N(f3bESOE=g>0l#hK-bG<_o zhE2o!tBa{!k~G3Kt-5aLQe|SR*lRxmm5I1$$#l@DP)i5eemD*WOu!601y92>@Cv*M z7vODp4?coL_!vHg&*5A65q^eW;Wzjl{(vhep^OR^p^BTZ5;tQUo3I)8U<j~s@Mv%fMOO6cw*8QD0w2DGc~iCe(7Y zN};#YKW5%}Sb$6LA$&rN`x1VDpWqkxlh`I>F_sb6Dlm%c@h+^!ZCHalumKy1cYAOz zc48Oq#{yHm=hH1G)AWuxFoZtUD zZ~gs$xlKEqPZ)tP0{>zJFu$X(qm4Su{qk7aH@|DgD4(Rv6Stce=(|wiU&jgk>p0=n gKMbiJBUA2^2yk8?Nhtm29|FSjKRo|^=H1@KUoh4BlmGw# From fe3feddb900b268bd305bda10694f90ff1fbea2d Mon Sep 17 00:00:00 2001 From: Leandro Balaguer Date: Sat, 3 Sep 2022 17:04:07 +0200 Subject: [PATCH 7/7] Create .gitignore --- .gitignore | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..6509c9117 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk