Result of:
true && false
What is false?
This keyword begins a conditional statement in JavaScript.
What is if?
The name for a loop that never stops running.
What is an infinite loop.
A named container that stores a value in your program.
What is a variable?
This graphics element is where JavaScript games draw their graphics.
What is the canvas?
let x = 5;
x > 3 || x < 0
What is true?
This keyword runs a block of code when the if condition is false.
What is else?
This is how many times "Go" prints:
let i = 0;
while (i < 3)
{
console.log("Go!");
i++;
}
What is 3?
This is the term for a value of true or false.
What is a boolean?
This is the location of the origin (0, 0) on a canvas.
What is the top-left corner?
This operator flips a boolean.
What is ! (Not).
let score = 75;
if (score >= 90) { console.log("A"); }
else if (score >= 80) { console.log("B"); }
else if (score >= 70) { console.log("C"); }
else { console.log("F"); }
What is the output?
What is C?
This loop will run forever without this line:
let enemies = 5;
while (enemies > 0) { console.log("Fighting!"); }
What is enemies-- or enemies = enemies - 1.
This term describes a reusable block of code that performs a task and can be called by name.
What is a function?
The two methods used to "get" the size of the canvas.
What is getWidth() & getHeight()
let a = 4;
let b = 9;
(a < 5 && b > 10) || !(a == 4)
What is false?
Find the bug:
let lives = 3;
if(lives = 0){ console.log("You have no more lives");}
else{console.log("Let's play")}
The final value of count after the end of the loop.
let count = 10;
while (count > 2) { count -= 3; }
What is 1?
This is the term for the process of finding and fixing errors in your code.
What is debugging?
The dimensions of the pole(p):
const buildWidth = 50;
const buildHeight =175;
const x = 150;
const y = getHeight();
let b = new Rectangle(buildWidth, buildHeight);
b.setPosition(x, y);
add(b)
let p = new Rectangle(5, buildHeight/7);
p.setPosition(x + (buildWidth/2), y - buildHeight);
add(p)
What is width: 5 height: 25.
A player can jump only if they are on the ground, OR if they have a double jump available AND are NOT stunned. Write the expression that correctly represents that rule, using onGround, hasDoubleJump, and isStunned.
What is onGround || (hasDoubleJump && !isStunned).
let healt = 0;
let hasShield = true;
if (health > 0) { console.log("Alive"); }
if (hasShield) { console.log("Protected"); }
else { console.log("Exposed"); }
The output?
What is Protected?
The number of times the loop will run.
let x=0;
while(x<10){
x+=2;
x++;}
What is 4?
The term for a specific set of instructions for the computer to execute in an effort to complete a designated task.
What is an algorithm?
The position of the pole(p) - canvas size (400, 480):
const buildWidth = 50;
const buildHeight =175;
const x = 150;
const y = getHeight();
let b = new Rectangle(buildWidth, buildHeight);
b.setPosition(x, y);
add(b)
let p = new Rectangle(5, buildHeight/7);
p.setPosition(x + (buildWidth/2), y - buildHeight);
add(p)