Skip to content
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

Pigs 20 threshold #420

Open
wants to merge 12 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
Binary file added .DS_Store
Binary file not shown.
Binary file added 01-Fundamentals-Part-1/.DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions 01-Fundamentals-Part-1/starter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@
</head>
<body>
<h1>JavaScript Fundamentals – Part 1</h1>

<script src="script.js"></script>
</body>
</html>
54 changes: 54 additions & 0 deletions 01-Fundamentals-Part-1/starter/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
let js = "amazing";
//if (js === "amazing") alert("JavaScript is FUN!");

//40 + 8 + 23 - 10;
console.log(40 + 8 + 23 - 10);

let firstName = "Dan";
console.log(firstName);


console.log(country);
console.log(continent);
console.log(population);

let population = 350000000;
let country = "United States";
let continent = "North America";
let language = "English";

console.log(population / 2);
console.log(population + 1);
console.log(population > 6000000);
console.log(population < 33000000);
console.log(
country +
" is in " +
continent +
", and its " +
population +
" people speak " +
language
);


const age = 12;
const isOldEnough = age >= 18;

if (age >= 18) {
console.log(`Sarah can start driving licence!`);
} else {
const yearsLeft = 18 - age;
console.log(`Sarah is too young, wait another ${yearsLeft} years.`);
}

let century;
const birthYear = 1994;
if (birthYear <= 2000) {
century = 20;
} else {
century = 21;
}
console.log(century);
*/
223 changes: 223 additions & 0 deletions 02-Fundamentals-Part-2/starter/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
"use strict";
/*
function logger(myName) {
console.log(`My name is ${myName}`);
}

logger("Dan");
logger("Bob");

function fruitProcessor(apples, oranges) {
console.log(apples, oranges);
const juice = `Juice with ${apples} apples and ${oranges} oranges.`;
return juice;
}

console.log(fruitProcessor(5, 1));

const calcAge3 = (birthYear) => 2037 - birthYear;
console.log(calcAge3(1994));

const calcAverage = (scr1, scr2, scr3) => (scr1 + scr2 + scr3) / 3;

let scoreDolphins = calcAverage(44, 23, 71);
let scoreKoalas = calcAverage(65, 54, 49);

function checkWinner(avgDolphins, avgKoalas) {
if (avgKoalas > avgDolphins * 2) {
console.log(`Koalas win (${avgKoalas} vs. ${avgDolphins})`);
} else if (avgDolphins > avgKoalas * 2) {
console.log(`Koalas win (${avgDolphins} vs. ${avgKoalas})`);
} else {
console.log(`No team wins...`);
}
}

checkWinner(scoreDolphins, scoreKoalas);
*/

/*
const friends = ["Michael", "Steven", "Peter"];
console.log(friends);

console.log(friends[0]);
console.log(friends[2]);

console.log(friends.length);
console.log(friends[friends.length - 1]);

friends[2] = "Jay";
console.log(friends);

const dan = ["Dan", "Bekenstein", 2024 - 1994, "Product Manager", friends];
console.log(dan);
console.log(dan.length);

const calcAge = function (birthYear) {
return 2037 - birthYear;
};
const years = [1990, 1967, 2002, 2010, 2018];

const age1 = calcAge(years[0]);
const age2 = calcAge(years[1]);
const age3 = calcAge(years[years.length - 1]);
console.log(age1, age2, age3);
*/

/*
const friends = ["Michael", "Steven", "Peter"];
const newLength = friends.push("Jay");
console.log(friends);
console.log(newLength);

friends.unshift("John");
console.log(friends);

const popped = friends.pop();
console.log(friends);
console.log(popped);

friends.shift();
console.log(friends);

console.log(friends.indexOf("Steven"));

console.log(friends.includes("Peter"));
console.log(friends.includes("Dan"));

if (friends.includes("Steven")) {
console.log("You have a friend called Steven");
}
*/
/*
const dan = {
firstName: "Dan",
lastName: "Bekenstein",
age: 2024 - 1994,
job: "Product Manager",
friends: ["Tim", "Justin", "Greg"],
};

console.log(dan);
console.log(dan.lastName);
console.log(dan["lastName"]);

const nameKey = "Name";

console.log(dan["first" + nameKey]);
console.log(dan["last" + nameKey]);

// const interestedIn = prompt(
// "What do you want to know about Dan? Choose between firstName, lastName, age, job, and friends"
// );
// console.log(dan[interestedIn]);


dan.location = "US";
dan["city"] = "Boston";

console.log(dan);

console.log(
`${dan.firstName} has ${dan.friends.length} friends, and his best friend is called ${dan.friends[0]}`
);

const dan1 = {
firstName: "Dan",
lastName: "Bekenstein",
// age: 2024 - 1994,
job: "Product Manager",
friends: ["Tim", "Justin", "Greg"],
birthYear: 1994,
hasDriversLicense: true,

calcAge: function () {
this.age = 2024 - this.birthYear;
return this.age;
},

getSummary: function () {
return `${this.firstName} is a ${this.calcAge()}-year old ${
this.job
}, and he has ${this.hasDriversLicense ? "a" : "no"} driver's license.`;
},
};
console.log(dan1.calcAge());

console.log(dan1.age);

console.log(dan1.getSummary());
*/

// for (let rep = 1; rep <= 10; rep++) {
// console.log(`Lifting weights repetition ${rep}`);
// }
/*
const dan = [
"Dan",
"Bekenstein",
2024 - 1994,
"Product Manager",
["Tim", "Justin", "Greg"],
true,
];

const types = [];

for (let i = 0; i < dan.length; i++) {
console.log(dan[i], typeof dan[i]);

// types[i] = typeof dan[i];
types.push(typeof dan[i]);
}

console.log(types);

const years = [1991, 2007, 1969, 2020];
const ages = [];

for (let i = 0; i < years.length; i++) {
ages.push(2024 - years[i]);
}
console.log(years, ages);


const dan = [
"Dan",
"Bekenstein",
2024 - 1994,
"Product Manager",
["Tim", "Justin", "Greg"],
];

for (let i = dan.length - 1; i >= 0; i--) {
console.log(dan[i]);
}

for (let exercise = 1; exercise < 4; exercise++) {
console.log(`----Starting exercise---- ${exercise}`);

for (let rep = 1; rep < 6; rep++) {
console.log(`Lifting weight repetition ${rep}`);
}
}
*/

// for (let rep = 1; rep <= 10; rep++) {
// console.log(`Lifting weights repetition ${rep}`);
// }

// let rep = 1;
// while (rep <= 10) {
// console.log(`Lifting weights repetition ${rep}`);
// rep++;
// }

let dice = Math.trunc(Math.random() * 6) + 1;
// console.log(dice);

while (dice != 6) {
console.log(`You rolled a ${dice}`);
dice = Math.trunc(Math.random() * 6) + 1;
if (dice === 6) console.log("Loop is about to end...");
}
3 changes: 3 additions & 0 deletions 03-Developer-Skills/starter/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"singleQuote": true
}
16 changes: 16 additions & 0 deletions 03-Developer-Skills/starter/script.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
// Remember, we're gonna use strict mode in all scripts now!
'use strict';

const temps1 = [17, 21, 23];
const temps2 = [12, 5, -4, 0, 4];

// function that takes a temp and number to return a string in the right format
//function that takes in an array and formats the arr

const printForecast = function (arr) {
let forecast = '... ';
for (let i = 0; i < arr.length; i++) {
forecast += `${arr[i]}*C in ${i + 1} days ... `;
}
return forecast;
};

console.log(printForecast(temps1));
console.log(printForecast(temps2));
Binary file added 04-HTML-CSS/.DS_Store
Binary file not shown.
Binary file added 04-HTML-CSS/final/.DS_Store
Binary file not shown.
4 changes: 1 addition & 3 deletions 04-HTML-CSS/final/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ <h1>JavaScript is fun, but so is HTML & CSS!</h1>
</p>

<h2>Another heading</h2>
<p class="second">
Just another paragraph
</p>
<p class="second">Just another paragraph</p>

<img
id="course-image"
Expand Down
34 changes: 34 additions & 0 deletions 04-HTML-CSS/starter/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Learning HTML & CSS</title>
<link href="style1.css" rel="stylesheet" />
</head>
<body>
<h1>JavaScript is fun, but so is HTML & CSS!</h1>
<p class="first">
You can learn JavaScript without HTML and CSS, but for DOM manipulation
it's useful to have some basic ideas of HTML & CSS. You can learn more

<a
href="https://www.championsoccerschool.com/about/staff/daniel-bekenstein/"
>about me</a
>.
</p>
<h2>Another Heading</h2>
<p class="second">Just another paragraph</p>
<img
id="dan-image"
src="https://i0.wp.com/www.championsoccerschool.com/wp-content/uploads/2016/03/beks.jpg?resize=705%2C435&ssl=1"
/>

<form id="your-name">
<h2>Your name here</h2>
<p class="first">Please fill in this form :)</p>
<input type="text" placeholder="Your Name" />
<button>Ok!</button>
</form>
</body>
</html>
Loading