Spelling, grammar and punctuation of a programming language.
Example: Every line of code ends with a semi-colon ;
Basic Syntax
a step-by-step set of instructions for completing a task. When algorithms are written using code, computers can follow them.
algorithm
What is the object in the following code?
game.spawnXY(name, x, y)
game
The act of adding one string to another using the “+” operator.
concatenation
An diagram of a program, done in shapes.
Flow Chart
hero.moveLeft (3); What is the3?
Arguement
A part of a program that tells a computer to perform an action, like assign a value to a variable.
Statement
The act of creating a new object in a scene while a game is running.
Spawning
The combination of one or more values using an operator.
expression
A detailed outline or rough draft of a program. Done in words.
pseudocode
Used to repeat actions without having to write the same code over and over.
While Loop
Give an example of an expression.
The expression while pizza < 5 would evaluate to True if I have 3 pizzas, and to False if I have 6 pizzas.
In order to spawn a new collect goal into your scene, you will need:
game.addCollectGoal(amount)
How do you write an expression with a "float?"
It needs to have a decimal.
“Executing instructions repeatedly, either for a set number of times or depending on a condition” is a description of which programming construct?
Repetition
Data where the value can change. First used to define enemy, then passed as an argument to attack the enemy.
Variable
How is the way a computer reads instructions different from the way a human would understand them?
Humans can use their own knowledge and other clues to figure things out if they don't make sense. Computers can only execute exactly what they are told.
Imagine you wanted to spawn a munchkin at (38, 16). What statement would you write in order to do this?
game.spawnXY(“munchkin”, 38, 16)
What are return statements?
are added to the body of function definitions in order to pass a value back to the call statement.
What is a real/float number?
A variable type that represents a fraction.
What is moveRight() in the following code.
hero.moveRight();
method
Why are sequence and syntax important?
Computers only do exactly what you tell them, so the sequence is important because if the computer does the steps in the wrong order, the program doesn't turn out right. If there is an error in the syntax, the computer doesn't know how to read it at all.
What is wrong with the following?
game.spawnXY("captain", 9, 9)
game.spawnXY("goal, 52, 44)
Quotations are needed to open and close the string goal.
Python has conjunctions too! They are called _______?
Logical Operators
The computational method which is concerned with the removal of unnecessary detail is called...
Abstraction