AP CSP Programming Crash Course
Made by Owen Dechow
Learn to program from scratch, one small idea at a time. This course teaches the pseudocode language used on the AP Computer Science Principles exam, and every example runs right on the page. No installs, no setup. Just read, press run, and change things to see what happens.
Try it. Then change the message and run it again. That habit of tweaking an example to see what changes is the fastest way to learn, and you will use it in every chapter.
Jump Right In
- Introduction to Programming: AP CSP: the first lesson in the series.
- Platformer Example shows what you will be able to build by the end of the course. Play it first, then come back and learn how it works.
- Sandbox is a blank space to write and run your own programs, with no lessons attached.
What You Will Learn
By the end of this course you will be able to:
- Store and change information with variables
- Make programs decide things with conditionals
- Handle many values at once with lists
- Repeat work with loops
- Package code for reuse with procedures
- Ask the user for input
- Draw pictures, make animations, and build a simple game
You do not need any experience. If you can read this page, you can do this course.
How the Course Works
Each chapter is short and builds on the one before it, so it is best to go in order. Look for these as you read.
- Runnable code. Most code blocks have a run button. Each one is complete on its own, so you can run any example without running the others first.
- Reference code. Some blocks are only for reading, such as a function’s shape or a piece that goes inside a larger program. They cannot be run.
- Notes and warnings. These point out common mistakes, and how CSP differs from other languages like Python and JavaScript.
- Practice. Many chapters end with ideas to try on your own. Do them. Reading code and writing code are different skills, and only one of them is practiced by reading.
Table of Contents
Getting Started
The Building Blocks
Collections, Code Reuse, and Loops
Drawing and Games
- Getting Started with Rendering
- Shapes, Lines, and Text
- Animation
- Drawing Many Things
- Keyboard Input
- Creating a Very Simple Platformer
A Peek at Where You Are Headed
By chapter 12 you will be drawing on a canvas. This tiny program is the kind of thing you will write, and the chapters will explain every line of it.
That is a crescent moon. By chapter 17 you will be steering a character around a level.
Tips for Success
- Type, don’t paste. Typing code forces you to notice each part.
- Break things on purpose. Delete a line, misspell a word, change a number. Seeing how a program fails teaches you how it works.
- Read the error message. It usually tells you exactly what went wrong and where.
- Take it slowly. A chapter is a good session. Come back tomorrow for the next one.
Ready? Start with Introduction to Programming: AP CSP.