Skip to content

didnt do password #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions starter-code/lib/harryPotter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
var birthdays = ["Severus Snape", "9 January", "Arthur Weasley", "6 February",
function get2Darray(array, newArray) {
var person = [];

for (i = 0; i < array.length; i += 2) {
person = _.reduce(array, function(name, date) {
return array[i] + ' ' + array[i + 1];
})
newArray.push(person);
}
return newArray;
}

function getArray2d(array) {
return _.chunk(array, 2);
}

function addObjects(first, second) {
return _.concat(first, second);
}

var birthdays = ["Severus Snape", "9 January", "Arthur Weasley", "6 February",
"Ron Weasley", "1 March", "Remus Lupin", "10 March",
"Fred & George Weasley", "1 April", "Pomona Sprout", "15 May",
"Draco Malfoy", "5 June", "Dobby", "28 June",
Expand All @@ -7,4 +27,11 @@
"Hermione Granger", "19 September", "Minerva McGonagall",
"4 October", "Filius Flitwick", "17 October", "Molly Weasley",
"30 October", "Bill Weasley", "29 November", "Rubeus Hagrid",
"6 December", "Charlie Weasley", "12 December"];
"6 December", "Charlie Weasley", "12 December"];

var moreBirthdays = ["Lily Evans", "30 January", "James Potter", "27 March",
"Dudley Dursley", "30 June", "Tom Riddle", "31 December"];

var arraypp = addObjects(moreBirthdays, birthdays);
var array2d = getArray2d(birthdays);

35 changes: 35 additions & 0 deletions starter-code/lib/office.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
function getOpinion(collection) {
return _.sample(collection);
}

function getEmployee(array, object) {
array.push(object);
}

function getOfficeSatisfaction(array, collection) {
var dept = [];
var i = 0;
var j;

while (i < 5) {
j = 0;
while (j < 10) {
getEmployee(dept, getOpinion(collection));
j += 1;
}
getEmployee(array, dept);
dept = [];
i += 1;
}
return array;
}

var opinions = [ "This is the best job ever",
"Satisfied",
"At least I get paid",
"I'm looking for another job",
"I don't want to answer"];

var office = [];

getOfficeSatisfaction(office, opinions);
10 changes: 10 additions & 0 deletions starter-code/lib/password.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function isPasswordCorrect(input) {
var dup = input;

}

var goodPswd = "1234567890";
var badPswd = "1123456";

console.log(isPasswordCorrect(goodPswd));
console.log(isPasswordCorrect(badPswd));
6 changes: 6 additions & 0 deletions starter-code/lodash.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<!DOCTYPE html>

<html>

<head>
<title>Lodash scripts</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.16.4/lodash.js"></script>
<script src="./lib/office.js"></script>
<script src="./lib/password.js"></script>
<script src="./lib/abbeyRoad.js"></script>
<script src="./lib/harryPotter.js"></script>
</head>
Expand All @@ -13,5 +17,7 @@
<li>Press 'Ctrl' + 'Shift' + 'J' (Windows / Linux)</li>
<li>or 'Cmd' + 'Opt' + 'J' (Mac).</li>
</ul>

</body>

</html>