Things that can pass through the green glass door.
Words with double letters.
if (target === "Thanos" || target === "Lokey") {
avengersNeeded = 8;
}
The meaning of || in this code.
OR
The shortest way to write c = c + 1;
c++;
Code to create a new variable called radius with a value of 6;
var radius = 6;
The error in:
if (weather = "rainy") {
tool = "umbrella";
}
using = instead of ===
A group of lines of code that other code can run, optionally with parameters.
if (score <= 79) {
grade = "C";
} else if (score <= 89) {
grade = "B";
} else {
grade = "A";
}
Your grade if your score is 89.
The value of 10 * i + 15 when i is 4.
55
// missing line of code here.
fill(251, 212, 44);
rect(10, 10, 186, 269);
textSize(93);
fill(0);
text("NATIONAL", 234, 130);
text("GEOGRAPHIC", 234, 230);
The missing line of code that would make the line 28 pixels thick.
*This code draws the National Geographic symbol.
strokeWeight(38);
The error in:
while foodOnPlate > 0 {
eatFood();
foodOnPlate--;
}
The missing parentheses around (foodOnPlate > 0).
Official instructions on how to use the functions and variables provided by a library.
documentation or "docs"
var x = 0;
while (x < 100) {
drawPlanet(x,100);
x += 10;
}
The number of planets drawn.
*Remember that ceil(random(0,3)) returns either 1, 2, or 3, randomly, like rolling a die or a number cube.
10
The function that rounds any number DOWN to the nearest integer.
floor()
fill(100,100,100);
line(0,0,400,400);
The color of the line drawn.
red
The error in:
while (x < 350) {
drawRedBalloon(x, 150);
x += 40;
} else {
drawBlackBalloon(x, 150);
}
`while` loops can't have `else` blocks.
The number of times rect() is called in:
for (var i=0; i<5; i++) {
rect(i*20, i*20, 10, 10);
}
5
The value of `player` after:
var turn = 16;
player = turn % 7;
2
Code to draw a line down the middle of the canvas.
Remember the canvas is 400x400.
line(200,0,200,400);
The error in:
fill(10,30,50);
textSize(15);
text(It's party time!, 40, 55);
The missing quotation marks around "It's party time!"
A keyword that leaves a function, optionally carrying a value to the code that called it.
return
if (airlineProvidesSnacks === true) {
snacksToPack = "none";
}
The code to write after this to set snacksToPack to "sandwiches" if airlineProvidesSnacks isn't true.
else {
snacksToPack = "sandwiches";
}
The highest possible value returned by random(0,4).
3.999...
draw = function() {
if (mouseIsPressed) {
fill(0);
ellipse(mouseX,mouseY,10,10);
}
}
The program created by this code.
a painting program
var pacManY = 80;
var drawPacMan() {
var pacManX = 40;
fill(255,255,0);
ellipse(pacManX, pacManY, 20, 20);
}
draw = function() {
drawPacMan();
pacManX += 2;
}
The reason for the error on the line "pacManX += 2;"