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? What is the Code Used

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.

HINT: It has the same name of an animal

camelCase

200

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

For Loop

200

What does the following code do: gemCounter = gemCounter + 2

Adds 2 to 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()? 

Hint: It goes between the two words


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: ! ?

Not 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

What does the || operator stand for 

Or

400

How can we reassign a variable with a different value?

Hint we do this with the gemCounter

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?

Hint: Starts with an S

Syntax

500

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

Condition (isBlocked, isOnGem, etc.)

500

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

True.

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 2 components of a Type?

Properties and Methods