Font size
WorksheetsProgramming in JavaScript
Total questions: 11
Worksheet time: 8mins
Which are the following are commands, (not variables)?
c.fillStyle = 'green';
color = 'pink';
c.fillRect(50, 120, 10, 300);
drawStackedBoxes(10, 10, 50, 100);
Ah! There's a bug in this command! How should we debug?
c.fillstyle = 'blue';
It should be "blue"
Capitalize the s
Add a space after "c."
Capitalize the f
I need some help assigning the value of 1 to the variable x. What should I do?
1=x;
=1x;
;=x1
x=1;
I used the (a) analogy to describe what a variable is.
A function is a series of (a) grouped together.
How many times can I use a function?
1 time
5 times
100 times
Infinite times (there is no limit)
Which of the following contain arguments?
function paintCanvas(color) {
function drawPlayer(x, y) {
drawCanvas();
drawPlayer(150, 20, 'red', 'blue');
Which of the following are examples of User Input?
Key Click
Button Click
Joystick
Eating
Why is the setInterval command useful?
We can loop a block of code infinite times
We create an interval of between the loops
We can tell the functions to run by themselves without calling them
We can automatically assign value to variables
Write any example of an if-else statement! Remember the one I used:
IF you eat all your dinner, then you can have dessert; ELSE (otherwise) you can just sit
here and watch everyone else have dessert.
Which are game states?
Menu Screen
Finish Screen
Playing the game
Debugging your game
