Html/CSS/JavaScript & Karel Answers With Explanations
function start(){
var partOfDay = "morning,";
var time = 8;
time=8;
println("in the " + partOfDay + " I woke up at " + time );
partOfDay = "afternoon,";
time=12;
println("in the " + partOfDay + "I woke up at " + time );
partOfDay = "evening,";
time=11;
println("in the " + partOfDay + "go to bed at " + time );
}
function start(){
var name= readLine("Hi, What is your name?" );
println("hello" + name + "nice to meet you" );
var age = readInt("What is your age? ");
println("You are " + age + " years old.");
}
function main(){
let die1 = Randomizer.nextInt(1,6);
let die2 = Randomizer.nextInt(1,6);
let rolls = die1 + die2;
let isroll = die1 == die2;
let attempts = 0;
let run=true;
while (isroll == true) {
console.log("you rolled" + rolls);
attempts = attempts++;
if (die1 == die2){
break;
}
}
console.log("It took you " + attempts + " rolls to get snake eyes.");
}
main();
function main(){
let correct="abc123";
let password = readLine("Enter password: ");
let run = password != correct;
while (run == true){
console.log("Sorry, that did not match. Please try again.");
password = readLine("Enter password: ");
if (password == correct){
break;
}
}
console.log("You got it!");
}
main();