What word does our conditions begin with?
is
What loop do we use when the puzzle randomizes the number of spaces?
While loop
What is this the name of operator " = "?
Assignment Operator
How do we define a variable and a constant?
let
How do we turn off a blue portal using correct syntax?
bluePortal.isActive = false
What is the term that a loop inside a function called?
Nesting
Using proper syntax create a loop that repeats moveForward() 20 times.
for i in 1...20 {
moveForward()
}
What are the 3 logical operators?
&& - AND
|| - OR
! - NOT
How do we initialize "expert"?
let expert = Expert()
What is the proper syntax to turn a lock up?
expert.turnLockUp()
What are the terms for creating a function and using it?
Define
Call
What is the correct syntax for For Loops?
for i in 1... # { ... }
What operator can we not use in our conditional statements and/or while loops?
Assignment Operator - " = "
(We can use all of these: <, <=, >, >=, ==, !=, !, ||, &&)
How do we initialize Byte?
let character = Character()
What is the difference between "Methods" & "Properties"?
Property = variable defined inside of a Type, value than can be manipulated using an instance.
Method = Actions that an item does. You can create or define methods and then call on them.
What happens if my if conditions and my else if conditions are false?
Nothing; moves on to the next lines of code
What is the correct syntax for a While Loop?
while condition { ... }
What operator are we using here: " age += 11"
Compound assignment operator
We initialized a variable "age". How do we assign an integer of "55" the variable? (You can say "equals")
age = 55
Give me an example of a property AND an example of a method using "expert"
expert.moveForward()
expert.gemsCollected = 4
Provide the proper syntax for the following conditional: if I am on a gem, I will collect it, else if I am on a off switch, I will turn on the switch
if isOnGem {
collectGem()
} else if isOnClosedSwitch {
toggleSwitch()
}
What is the difference between a For Loop and a While Loop?
A for loop is for a certain number of times
While Loop is for when we don't know the number of times to repeat/loops with a condition
What are the following operators in this order:
<, <=, >, >=, ==, !=
Less than, Less than or equal to, Greater than, Greater than or equal to, Equals to, Not equal to
What is the difference between a variable and a constant?
Variables values can be changed
Constant values CANNOT be changed
What are the 4 components of a Type?
Dot Notation, Methods, Instance, & Property