Skip to content
Open
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
51 changes: 51 additions & 0 deletions solution.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// "Get Even"
for (let i = 0; i <= 200; i+=2){
console.log(i);
}

// "Excited Kitten Part 1"
for ( let i = 0; i < 10; i++){
console.log("Love me, pet me! HSSSSSS!");
}

// " Excitd Kitten Part 2"
for ( let i = 0; i < 10; i++){
const sentences = ["...human...why you taking pictures of me?...", "...the catnip made me do it...", "meow?", "...why does the red dot always get away..."];
if (i % 2 === 0) {
const randomNumber = Math.floor(Math.random()*sentences.length);
console.log(sentences[randomNumber])
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice start here! if you like we can talk through this, it's definitely a lot to think through!


// "Thermostat"

let currentTemp = Math.floor(Math.random() * 101);
const desiredTemp = 72;

console.log('The temperature is: ' + currentTemp + 'F');

while (currentTemp < desiredTemp) {
currentTemp++;
console.log("The temperature is now: " + currentTemp + 'F');
}

while (currentTemp > desiredTemp) {
currentTemp--;
console.log("The temperature is now: " + currentTemp + 'F');
}

// "FizzBuzz"

for (let i= 1; i < 100; i++){
if (i % 3 === 0){
console.log("Fizz");
}
else if (i % 5 === 0){
console.log("Buzz");
}
else if (i % 3 === 0 && i % 5 === 0){
console.log("FizzBuzz");
} else {
console.log(i)
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're really close here! it's important to remember that the most specific condition (checking against 3 AND 5 at the same time) should happen first. otherwise, a number like 15 will get caught in the FIRST condition it meets (in this case, checking against 3 in line 40).