Debugging and Clean Coding
Programming Fundamentals
BONUS
Game Development
100

We refer to this as "blanks", characters that represent space between other characters.

What is whitespace?

100

This is the keyword for creating a variable in JS.

(Bonus for double points: These are two other keywords for creating variables in JS)

What is "var"?

100

We end most lines of code with this in JavaScript.

(EASY POINTS!!)

What is a semicolon?

100

This is the name of the JavaScript library we're using that provides us built-in drawing commands.

What is P5.js?

(Another acceptable answer: what is the Processing library?)

200

This is essential in writing clean code, as it allows programmers to easily see which code falls within the selection or iteration, and where it ends.

What is indentation?

200

This is the syntax for declaring a function in JS. 

(Bonus, for 100 points: this is how you call a function in JS)

What is the below code, or something comparable?

function example() {

}

-or-

var example = function() {

};

Bonus: what is "example();" ?

200

This is the study of problems, problem-solving, and the solutions that come out of the problem-solving process.

What is computer science?

200

This was the first commercially successful video game.

What is the pong game?

300

True or False: You have have two draw functions in your program.

What is false?

Pro-tip: you cannot have multiple setup or preload functions either!

300

This is the syntax for writing an if statement in JS.

What is the following?

if (condition) {

//code that should happen if the condition is true

}

300

Using App Lab, we learned about onEvent functions.

This is the difference between "event-driven programming" vs. sequential programming.

What is code that runs constantly, and checks for the occurence of an event, vs. code that runs from top to bottom - line by line in order?

300

Often, you write this command at the beginning of your draw loop if you're creating a program involving animation. This commands gives the illusion that an image/shape is moving across the page, as opposed to being re-printed to the screen multiple times.

What is background()?

400

These are two ways you can write comments in JS.

What are "//" and "/* */"?

400

This is how you write AND and OR in Javascript.

(Bonus: these are additional logic operators you can use in your conditional statements)

What are the following: && and ||?

Bonus: equality operators, NOT symbol, etc.

400

These are the 4 programming problem solving steps.

(Bonus for 100 points: these are examples of how to apply each problem solving step)

What is Define, Prepare, Try, and Reflect?

Bonus: what is an example that is verified by the group?

400
These are 4 essential components of all games.

What are the following key components?

Goals, rules, challenge, and interactivity. Games generally involve mental or physical stimulation, and sometimes both.

500

This is a function we should check for if we notice an animation is not working. Typically, this is the root of the problem.

What is the fact that we're not using a draw loop? What is not incrementing your variable? What is not using variables for our drawings?

500

This is how to create a for loop that will run three times, and print the message "HEY!" to the screen each time it runs.

What is the below code, or something comparable?

for (var i = 0; i < 2; i++) {

alert("HEY!");

}

500

Increasing or decreasing numbers is a common and incredibly useful pattern in programming. This  can be used, for example, to make an image fly across the screen, to count down a timer, or to keep track of clicks.

(Bonus for 100 points: providing an example of what this looks like in JavaScript)

What is a counter pattern?

Bonus: what is the following example or something comparable?

x = x + 1;

or

x++;

500

This is the result of writing code (by hand) that does the following:

Create a function called gameOver and place code inside of it that does the following... Creates a black screen background to the screen with the phrase "GAME OVER" in the center of the screen. The text should be the color white and 50 pixels in size.

What is the below code, or something comparable?

function gameOver() {

background(0);

textSize(50);

fill(255);

text("GAME OVER", windowWidth/2, windowHeight/2);

}

M
e
n
u