Algorithms and Programming (CS1)_ Lesson 1 - Syntax & Sequences
Algorithms and Programming (CS1)_ Lesson 1 - Syntax & Sequences
Quest #1
Syntax & Sequences
Let’s Review…
CODING CONCEPTS
1 What did we talk about last time?
COMPLETE QUESTS
4 Are there any quests you want to review?
Quest #1
By the end of my quest, I
will be able to…
Image Source
Program (Software)
A set of instructions that tells our computer to
do something.
Statements & Code Segments
Statement: A line of code
that tells a computer to
perform a specific action.
Code Segment: A group of
statements that work together
to perform a specific action.
Subgoal 1: Build
- Grab 2 slices of bread.
- Cut 3 slices of cheese.
- Put slices of cheese in between
slices of bread…
Subgoal 2: Grill
- What are the steps?
Warm-Up
Write down a sequence of steps (algorithm) to help the hero
collect all the coins. What order will these statements be
executed?
1. Move up
2. Move right
3.
4.
5.
6.
7.
8.
Warm-Up: Solution
1. Move up
2. Move right
3. Move up
4. Move right
5. Move down
6. Move right
7. Move down
8. Move right
To the Dungeon!
1. Level goals and completion status 4. The editor window is where you will write your
2. Game controls (play/pause, volume, clock slider, zoom) own code. There is an autocomplete feature!
and select object properties 5. Click “HINTS” for more information if you get
3. Statements and code segments available in the level; click stuck.
on any method to learn how to use it 6. Click “RUN” to test your code. Test often!
Game Recap: Dungeons of Kithgard
Starter Code 👀
Python
Concept Video: Basic Syntax
Syntax - Calling Methods
This statement calls a method!
A method call contains three
pieces of information: Python Syntax:
Python
Program Documentation
Python
Finding and Fixing Errors
You’re going to make mistakes. That’s a very NORMAL part of coding, even for
experts. Finding and fixing errors (debugging) is an important part of
programming. Consider using the following tools when debugging your
programs:
Python
Independent Practice
Log into CodeCombat
https://codecombat.com/
Play Levels
CS1 Levels 1-3b, CC Careful Steps
Need Help?
Ask a friend or AI!
Key Terms (1/3)
● Program: A set of instructions that tells our
computer to do something. Also known as software.
hero.moveUp()
argument
# Comment in Python
4
6
1
Wrap-Up 1
Explain how to play
CodeCombat to someone
who has never played
before. Your answer should
include the terms
“algorithm”, “method”, and
“call” for it to be considered
correct.
Wrap-Up 2
There’s a problem with the
following algorithm: