Scratch Sorting Hat Lesson
- Understand and use sequence in an algorithm
- Understand and use iteration in an algorithm (FOR and WHILE loops)
EDUCATOR: COMPUTATIONAL THINKING COMPETENCIES:
COMPUTER SCIENCE EDUCATORS:
CSTA K–12 CS Standards:
AREA OF LEARNING AND EXPERIENCE: Science and Technology:
Computation is the foundation for our digital world.
Progression step 3
- I can use conditional statements to add control and decision-making to algorithms.
- I can identify repeating patterns and use loops to make my algorithms more concise.
- I can explain and debug algorithms.
Progression step 4
- I can decompose given problems and select appropriate constructs to express solutions in a variety of environments.
- I can select and use data structures that efficiently manage data in algorithms.
- I can plan and implement test strategies to identify errors in programs.
Progression step 5
- I can identify, define and decompose problems, choose appropriate constructs and express solutions in a variety of environments.
- I can use file-handling techniques to manipulate data in algorithms.
- I can test, evaluate and improve a solution in software.
The Sorting Hat is an artefact used at Hogwarts in the Harry Potter books. The hat decides which of the four school houses (Gryffindor, Slytherin, Hufflepuff and Ravenclaw) each new student is assigned to. At the start of each school year, the Hat is placed on every first-year student's head. The Hat announces its choice aloud, and the student joins the selected house.
In this lesson, students will learn how to create a 'Harry Potter' style sorting hat with Scratch.
Show students the 'Sorting Hat' scene from Harry Potter and the Sorcerer's Stone to set the scene:
Ask students to look at the sample code (below) and try to work out what the code is doing. Click play button (right) to see if the students where right.
Using the sample 'Dice roll' solution above, challenge the students to create a program to simulate the roll of a dice.
Hint: Students can use this partially working example to help them with this task.
Using what you have learnt, challenge the students to create a 'Harry Potter' style sorting hat that will randomly pick a house from:
Hint: The students can use this partially working example to help them with this task:
Their finished program should look like this:
Challenge the students to create a name picker which will pick a person at random from their class.
Unless otherwise specified, everything in this repository is covered by the following licence:
Scratch tutorial, Scratch programming language, Scratch programming, Scratch coding.