Computer ScienceComputingMiddle schoolKey Stage 3
How to teach pseudocode
Pseudocode is a plan for a program written in plain English, one step per line. This page explains what students need to get right in pseudocode, with a free activity where Sparky turns each student's pseudocode for a game rule into Python they can run.
Jemel Fanfan | Founding Member at Flint

"Flint AI Tutor helped students with their Problem Statement Development. It helped them by identifying problem identification skills and focusing on data and facts to support their problem."
Anthony "Tony" Cesarano, Upper School Engineering and Computer Science TeacherWhy this matters
A student who can explain a game rule out loud can still write pseudocode that skips steps, like "then you lose and start over". A person reading that line fills in the missing steps without noticing, and a computer can't. On a worksheet the gap is easy to miss, and the teacher has to wait until the student's program breaks to find out which steps the plan left out.
What pseudocode is
Pseudocode describes the steps of an algorithm in plain language mixed with programming ideas such as assignment, conditions and loops. It is written for people to read, so it often leaves out details a computer needs (Wikipedia). The CSTA K-12 Computer Science Standards ask students in grades 6 to 8 to "use flowcharts and/or pseudocode to address complex problems as algorithms" (standard 2-AP-10, CSTA).
Pseudocode that a programmer can turn straight into code has three features that students' first drafts often lack.
- Each line is one action, and the action says what changes, such as "set hearts to 3" instead of "start over".
- Every condition can be checked, such as "if hearts is 0" instead of "if hearts are gone".
- Indentation shows which steps belong inside an if or a loop.
In the Flint activity, each student writes a rule from a game they play as pseudocode, and Sparky turns each line into Python, exactly as written, that the student runs in Flint's code editor. A worksheet can mark a step as unclear, and Sparky shows the student what a computer does with it by leaving a comment on each vague line saying Python doesn't know what it means.
Sparky shows Owen the steps his pseudocode skipped
Owen ends up rewriting two vague steps as lines that say what changes, then traces what three hits in a row do. Every student gets the same activity, and Sparky's replies depend on each student's own pseudocode.
Owen
Sparky

Owen
when player gets hit by enemylose a heart
if hearts are gone
then you lose and start over
Sparky

Owen
start over means you go back to the beginning of the level
Sparky
Owen
oh the hearts have to go back to 3 or you'd lose again right awayif hearts is 0
say game over
set hearts to 3
set player position to 0
Understanding check
Owen
hit 1 hearts go to 2, hit 2 hearts go to 1, hit 3 hearts go to 0 so it says game over, hearts go back to 3 and position goes to 0.Found two steps his pseudocode skipped and traced three hits
Owen is an example student, and Sparky's replies are shortened.
What Flint did for Owen
- Sparky turned Owen's pseudocode into Python line by line and marked "start over" with a comment instead of guessing.
- When Owen's rewrite stayed vague, Sparky pointed him back to his own code, and Owen wrote the reset himself.
- Once every line was clear, Sparky asked what three hits in a row would do, and Owen traced each one.
A teacher can't do this by hand for 30 students, and Sparky does it in every student's chat.
The activity page shows whose pseudocode still skips steps
While the class works, Needs attention shows the teacher which student is stuck and on which message. After three or more students submit, activity analytics lists what the class explained well, where students went wrong, and a follow-up to practice next.

Example activity page
After a computer science class writes their game rules
The school and students are made up for this page.
Set up the activity for free
The pseudocode activity is in Flint's public library, with the coin game interactive, Sparky's guidelines and the greeting already written. Open it, select Use activity to copy it into a free Flint account, and assign it to a class. Students write their pseudocode in the chat and press Execute in Flint's code editor to run the Python Sparky writes back.
For more computer science activities, see Flint for computer science.
Other use cases
See all use cases →Social StudiesHumanitiesHigh schoolKey Stages 4 and 5

How to teach rationing in World War II
What students need to understand about WW2 rationing in Britain, and a free activity: each student plans a week of meals on a real 1941 ration. A student who says Britain ran out of food gets sent back to the planner, and one who works out the ships gets a harder question about total war.
English Language ArtsEnglishMiddle schoolKey Stage 3

How to teach reading comprehension in middle school
How to teach reading comprehension in middle school with three strategies: start from what each student understood, ask for the line in the text that shows it, and push one step past the plot. Shown with a free Flint activity on "The Tell-Tale Heart".
Computer ScienceComputingHigh schoolKey Stages 4 and 5

How to teach recursion
How to teach recursion: what a recursive function and a base case are, and why a function without a base case never stops. In a free Flint activity, students write and run recursive functions in Python or Java, and Sparky asks for the base case instead of fixing the code.
