Back to the Basics
Functions & Loops
Smooth Operators
Var VS. Let
Other
100

Coding language that we are using in Playgrounds

Swift

100
How do we know when we are defining a function?

func

100

What is the correct term for the following operators: "||, &&, !"

Logical Operators

100
How do define a variable of age with the integer being 30? (Please do not say equals).

var age = 30

100

What is a constant?

A type of variable that it's data cannot be changed.

200

A specific type of syntax that we use for naming our functions and use for commands.

camelCase
200

Use this loop when you are specifying the number of times...

For Loop

200

What does the following code do: gemCounter -= 2

Takes away 2 from the gemCounter.

200

How do we initialize character in Playgrounds? (Please do not say equals)

let character = Character()

200

What do we use to tell expert to turnLockUp()?

Dot notation ". "

300

A term that is defined as "An error in code".

Bug

300

What is needed to place commands within the function and/or loop?

Curly Braces {}

300
What is the correct term for the following operator: = ?

Assignment Operator

300

How do we use our variables as conditions?

Using the <, >, !=, or == AND integers.

300
In Playgrounds, how do we turn off a green portal? (w/ correct syntax)

greenPortal.isActive = false

400

A term that is used when we place a for loop inside a function.

Nesting

400
Use this loop when a puzzle randomizes

While loop

400

True or false: You can use logical operators in a while loop (EX: while isOnGem && isBlockedRight)

True.

400

How can we reassign a variable with a different value?

Using an assignment operator OR increasing/decreasing its value by a certain number using a compound operator/assignment operator.

400

Provide 3 examples of a condition.

isOnGem, isBlocked, isBlockedRight, isBlockedLeft, isOnOpenSwitch, isOnClosedSwitch, 

500

What is the term we use when you follow proper grammar, punctuation, and rules in coding?

Syntax

500

What is needed to check if the while loop can run?

Condition (isBlocked, isOnGem, etc.)

500

What is the correct way to display a compound operator?

+= OR -=

500

What is the difference between var and let?

A variable can change its value when assigned to, and let is a constant that cannot be changed.

500

DAILY DOUBLE!

What are the 4 components of a Type?

M
e
n
u