Table of Contents
Vocab
Abstraction
The most fundamental idea in computer science, giving a name to something in a program to make it more readable.Procedural abstraction
Using a procedure to name an idea, ex. the procedure "who" to the idea of picking an item from the list of people or cats.Transparency
The transparency of an image is how much you can see what's behind it. For example, here is the Alonzo sprite shown with three different transparencies (which have been set using the ghost effect block).Expression
An expression is a either a constant value (such as "4" or "winter") or a call to a reporter block including its inputs (such asProcedures
A procedure is a named sequence of instructions that may take inputs and may report a value. Some languages call procedures methods or functions. Here are two types of procedures you have seen in Snap!Reporters
Reporters have an oval shape. They report a value.Commands
Commands have a jigsaw puzzle shape. They tell the computer to do something without reporting a value.List
A list is an ordered sequence of items. You've seen this example:Strings
The items of this list are strings. A string is a sequence of characters (letters, digits, punctuation, etc.). A substring is just a piece of some existing string. For example, "Hanna," "anna", and "nnah" are each substrings of the string "Hannah." (The empty string as well as the original string are both also substrings.)Concatenation
To concatenate strings means to make a bigger string by connecting two or more smaller strings. In Snap!, theAlgorithm
An algorithm is a sequence of steps that are usually performed by a computer. The algorithm doesn't have to be written in any particular programming language or even in a programming language at all; you can write your algorithm in English or any other human language.Pseudocode
Some people call an algorithm written in human language pseudocode. Once you know the steps that the computer will take, you can code your algorithm in the programming language of your choice. What's the purpose of "pseudocode"? Why write an algorithm vaguely in English when you could write it precisely in Snap!? If you were programming in a punctuation-heavy language, designing your program in pseudocode would help you focus on the important ideas instead of on details like quotation marks and semicolons. But pseudocode isn't as necessary with a language like Snap!, and pseudocode can make it easy for you to fall into wishful thinking about what the computer is capable of (such as writing "Pick tomorrow's winning lottery numbers" or "Here's the melody; write the harmony").Parameter
A parameter (or formal parameter) is the input name, such as number of branches. The input name is set in the block definition. It never changes.Argument
An argument (or actual argument) is the input value, such as 6 for a hexagonal pinwheel. The input value is given each time the block is run; it can be a different value each time.Personally Identifiable Information (PII)
Information that can identify you as an individual is called personally identifiable information (PII). It includes details that could reveal who you are—such as your Social Security number, age, race, phone number(s), medical information, financial information, or biometric data like a thumbprint or face scan.Values
Expressions are evaluated to produce a single value (a value can be a number, a string, a sprite, a costume, a script, a list—anything). For example,Iteration
Computer scientists describe a repeating program structure as looping, repetition, or iteration. The code can be repeated forever, a specific number of times (such as when using repeat), or until something specific happens (such as when using repeat until as you'll see in Lab 5).Sound Sensor
A sensor that outputs an analog signal based on the amount of ambient sound present. It is programmed using a value between 0 and 100, where 0 is the softest sound that can be detected and 100 is the loudest.Position Servo
Is a motor will turn to a specific angle from 0 to 270 degrees.Rotation Servo
Is a motor that will rotate continuously until turned off. Servo motors are very precise motors.Light Sensor
Is a sensor that detects ambient light. Light Sensors can be either digital or analog. The Light Sensor in your ITEEA ExCITE Robotics System is Digital and will report a value of 1 or 0 (on or off).Algorithm
A finite set of instructions used to accomplish a task. Ex. The instructions that move a robot to its final position.Sequencing
Statements execute in the order they appear unless the flow of control changes. EX. ROTATE_LEFT() followed by MOVE_FORWARD()Selection
Uses a condition to determine which part of an algorithm is executed. Ex.IF (x < 3)Iteration
Repeating a set of instructions in an algorithm. Ex. REPEAT 3 TIMESVariable
A named value that can change while a program runs. Ex. i in i ← 3Assignment
Stores a value in a variable. Ex. i ← 3Expression
A combination of values, variables, and operators that evaluates to a value. Ex.i - 1Condition
An expression that evaluates to either true or false. Ex. x < 3Boolean
A value that is either true or false. Ex. The result of x ≤ 1Relational Operator
Compares two values and produces a Boolean result. Ex. <, >, ≤, ≥, =, ≠Procedure
A named group of programming instructions that performs a task. Ex. PROCEDURE FancyMove(x)Procedure Call
Tells the program to execute a procedure. Ex. FancyMove(i)Parameter
A variable in a procedure definition that receives a value when the procedure is called. Ex. x in PROCEDURE FancyMove(x)Flow of Control
The order in which statements in a program are executed. Ex. An IF determines which branch runs.Nested Selection
A selection statement contained inside another selection statement. Ex. An IF inside an ELSE block.Nested Iteration
An iteration statement contained inside another iteration statement. Ex. REPEAT i TIMES inside REPEAT 3 TIMESVariable
A variable is like a labeled box that can hold one value at a time, such as one word, one costume, or one list (which can contain many things). You can look at what's inside as many times as you want.Local Variable
A local variable can be set or used only in the environment in which it is defined. This term includes inputs to procedures and variables created by the for or script variables block.Predicate
A predicate is a hexagon-shaped reporter that asks a true/false question such as these examples:Boolean value
Predicates report a Boolean value (eitherIf else Block
The if and if-else blocks are called conditionals because they control the code based on a true-or-false condition.Global Variable
A global variable is a variable that is usable by all scripts in the program.Index
he position number is called the index of the item in the list.Sublist
A sublist is a list used as an item of another list.(The word sublist is also used to refer to some subset of a list.)Data Types
A data type is what kind of data something is (number, text string, list, etc.). For example, number is the data type for the first input toAbstract Data Types
An abstract data type (ADT) is a custom data type that's meaningful to your program. It's not built into the language; you develop it as you code. This is an abstraction because it hides the details inside the constructor and selectors so that programmers working with crossing record think about timestamps and events, not list indices. -TheTable
A table is a two-dimensional data structure with rows and columns. If you've used a spreadsheet program, what it displays is a table. In Snap!, a table is implemented as a list of lists, in which each sublist is one row of the table.Consumption
Using the result from item as the input to date or time is called consumption of functions.Traversing a List
Traversing a list means looking at each item of the list. For each is iterative. That is, it’s repetitive, like for, which can also traverse a list. But unlike for, for each traverses the list without using index numbers.Important Blocks
broadcast
Sends a message to all the sprites. To set the message, click the down arrow and select "new..."when I receive
(Click help on the block to learned more about it in order to complete this definition)On the AP Exam
- Many languages (and the AP CS Principles Exam) use return instead of report as the name of the command to give a value back at the end of a function call.
- The exam uses “value of a procedure” to mean the value the procedure returns when called. For example, “the value of double(5)” means 10.
- There is nothing exactly like
or
on the AP Exam because they don’t have sprites and speech balloons, but their way of showing this text to the user is DISPLAY(gossip()) if it’s written as text or
if it’s shown as blocks. You won’t have to be able to write code in this notation on the AP exam. You just have to be able to read it so you can answer questions about it.
- The procedure
would be written as PROCEDURE double(x) { RETURN(2 * x) } or
Many languages (and the AP CS Principles Exam) use return instead of report as the name of the command to give a value back at the end of a function call. The exam uses “value of a procedure” to mean the value the procedure returns when called. For example, “the value of double(5)” means 10.
-The expression would be written as RANDOM(1, 10) or
Every time you run this code, you will get a different random number between 1 and 10.
-The procedure definition for the custom pinwheel command Would be written as
-The procedures move() and turn_clockwise() aren’t built in to the AP’s language so they are written in lower case like other programmer-defined procedures.
Notice that the hat block, would be written as PROCEDURE pinwheel(numberOfBranches). The word PROCEDURE tells you that that line of the code is like a hat block; the variable name in the parentheses on that line is the input that the procedure takes.
-This instruction would be written as Pinwheel(6, 80, 20) or You may hear people use the term “pseudocode” to refer to this pseudo-language used on the AP CS Principles exam, but it’s not pseudocode. Pseudocode isn’t a programming language at all, it’s the use of normal human language to describe an algorithm.
-
would be written as
.
-
The code
would be written as
Notice that the procedure INPUT() accepts the value from the user and returns that input value, which is then assigned to the variable userResponse with the ← syntax. In Snap!, this is just like how answer accepts a value from the user and reports it, and that report is what the computer sets the variable user response to.
-
(which means
) would be written as
-The list expressionwould be written as [Señora, Ms. C, my cat, Hannah, Jake]. The items are positioned in the list in the order they appear in the text: “Señora” has index 1, “Ms. C” has index 2, and so on.
-The assignment instruction would be written as
-The assignment instructionwould be written as
(In this app, you’ll want the shopping list to begin empty, and then the user will add or insert additional grocery items one at a time.)
- would be written as
- would be written as
-The items in a list are values, so you can use item of anywhere you can use any other expression. For example: You can assign a list item to a variable. On the exam… You can assign any value to a list item (a number, a string, a sprite, a costume, a script, another list, etc.). On the exam…
-When you run this script in Snap!, the second line of code assigns to shopping list 2 the value of shopping list (that is, the same list, not a copy). So, the third line of code modifies both variables:However on the exam, the statement shoppingList2 ← shoppingList makes a copy of the list. So modifying one of them does not modify the other.
The rules for how to use lists and how they behave differ depending on the programming language you are using.
-The script would be written as
The procedure goto() isn’t built in to the AP’s language so it is written in lower case like other programmer-defined procedures.
Markdown Style Guide for Coding Notebooks
Follow this guide to keep your coding notebook clear, consistent, and professional.
This ensures your notes are easy for you (and others) to read later.
Headings
When to use: Organize your notebook into sections (like days, topics, or projects).
-
#for the notebook title (use once at the top). -
##for each day or major topic. -
###for subsections (like “Notes”, “Practice”, “Reflections”).
Example:
My Coding Notebook
Day 1
Notes
Practice
Text Formatting
When to use: Highlight important ideas or add emphasis.
Use bold for key terms or definitions.
Use italic for emphasis or side comments.
Use inline code for keywords, functions, or commands.
Example:
Class = a blueprint for objects
Remember: always test your code
Use System.out.println() to print
Code Blocks
When to use: Anytime you write multiple lines of code.
Inline code for short snippets.
Fenced code blocks with language for full examples.
Example:
public class Hello {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Lists
When to use: Organize steps, notes, or key points.
Numbered lists for sequences or steps.
Bulleted lists for unordered ideas.
Example:
Define the class Write the main method Test your program Variables
-
Loops
-
Conditionals
Checklists
When to use: Track progress on assignments or tasks.
Example:
[x] Complete coding warm-up
-
Finish project draft
-
Reflect on learning
Blockquotes
When to use: Call out notes, reminders, or teacher comments.
Example:
💡 Remember: Loops repeat code until a condition is false.
Tables
When to use: Compare values, track progress, or organize data neatly.
Example:
| Task | Status | Notes |
|————–|————|—————–|
| Homework 1 | Done # | Submitted |
| Homework 2 | Pending | Needs review |
Links & Images
When to use: Add references, resources, or visuals.
Example:
To make an image that is a link, paste the image, then add the following before it, replacing website address with the link:
And after the image info, add: </a>
Collapsible Sections
When to use: Hide solutions, extended notes, or extra details.
Example:
Click to reveal solution
System.out.println("Answer: 42");Footnotes
When to use: Add references or side notes without cluttering the page.
Example:
This concept is related to object-oriented programming.1
Style Rules
Consistency matters more than creativity
Always use headings to structure your notes.
Always use code blocks for multi-line code.
Clarity first
Bold key terms.
Use lists instead of long sentences when outlining steps.
Professional tone
Don’t mix casual notes with formal work in the same section.
Use blockquotes for reflections or teacher feedback.
Track your learning
Use checklists to mark what’s done.
Use collapsible sections if you want to hide answers until review time.
Bottom Line:
Headings = Structure
Bold/Italic = Emphasis
Code blocks = Code
Lists = Steps/Ideas
Tables = Organization
Checklists = Progress
Blockquotes = Notes/Tips
Collapsible = Hide/Show detail
Keep it simple, consistent, and clear.
-
See “Objects and Classes” in your textbook. ↩