From a745f90bff50bbe060003096ee3ca692998ea67e Mon Sep 17 00:00:00 2001 From: Felipe Martinez Date: Thu, 17 Jan 2019 19:04:00 -0600 Subject: [PATCH] nada --- hoa.txt | 0 starter-code/basic-algorithms.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 hoa.txt diff --git a/hoa.txt b/hoa.txt new file mode 100644 index 000000000..e69de29bb diff --git a/starter-code/basic-algorithms.js b/starter-code/basic-algorithms.js index 82f20d8ba..475223945 100644 --- a/starter-code/basic-algorithms.js +++ b/starter-code/basic-algorithms.js @@ -1,7 +1,38 @@ // Names and Input +var hacker1 = "Carlos"; +console.log("The driver's name is", hacker1) + +var hacker2 = prompt("Como te llamas?"); + +console.log("The navigator's name is", hacker2) //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("Yo, navigator got the longest name, it has "+hacker2.length+" characters") + }else if(hacker1.length == hacker2.length){ + console.log("wow, you both got equally long names, "+hacker1.length+" characters") + }else{ + console.log("ERROR") + } // Lorem ipsum generator + +console.log(hacker1.split('').join(' ').toUpperCase()); + +console.log(hacker2.split("").reverse().join("")) + +var arange = [hacker1, hacker2] +arange.sort() +if(arange[0] == hacker1){ + console.log("The driver's name goes first") +}else if(arange[0] == hacker2){ + console.log("Yo, the navigator goes first definitely") +}else if(arange[0] && arange[1] == hacker1){ + console.log("What?! You both got the same name?") +}else{ + console.log("Error") +} \ No newline at end of file