Scratch Conditional Statements: Witch Wardrobe Halloween Coding Activity

What should a witch wear on Monday?

Apparently, striped socks.

At least, that’s the rule in our Witch Wardrobe Scratch coding activity, where kids use conditional statements to help Glenda choose what to wear based on the day of the week.

This Halloween Scratch project is a hands-on way to explore if/then statements, Boolean conditions, user input, sensing blocks, operators, and decision-making in computer programming.

Halloween Scratch coding activity using Witch Wardrobe to teach if then logic and conditional statements

The project is already built and ready to play, so younger coders can use it as a visual demonstration of conditional logic. Kids with more Scratch experience can open the project, explore the code, remix it, change the conditions, or build their own version.

Play the Witch Wardrobe Scratch project below.

Open or remix Witch Wardrobe on Scratch →

Looking for the screen-free version first? Start with our Halloween Conditional Code Worksheet, then come back here to see the same computer science concepts working inside an actual program.

What Is a Conditional Statement in Coding?

A conditional statement allows a computer program to make a decision based on whether a condition is true or false.

We use conditional thinking constantly in everyday life.

If it is raining, then take an umbrella.

If the light is red, then stop.

If it is Monday, then Glenda wears striped socks.

Each statement contains a condition and an action.

The program evaluates the condition first. If the condition is true, it runs the instructions associated with that condition.

That basic idea powers an enormous amount of computer programming.

What Does If/Then Mean?

An if statement essentially asks the computer a question.

For example:

if <answer = Monday> then
    wear striped socks
end

Scratch evaluates:

Is the answer Monday?

There are only two possible results.

True — the user entered Monday.

False — the user entered something else.

If the condition is true, Scratch runs the code inside the if block.

If it is false, Scratch skips those instructions and continues through the program.

That makes if statements one of the easiest ways to introduce kids to the idea that computers can appear to make decisions — but only according to rules written by programmers.

Meet Glenda and the Witch Wardrobe

Our Witch Wardrobe project turns conditional logic into something kids can see immediately.

Glenda asks:

What day of the week is it?

The player types an answer.

Scratch then checks that answer against the conditions programmed into the project and chooses the appropriate wardrobe item.

The rules in our project are:

If it is Monday, then Glenda wears striped socks.

If it is Tuesday, then Glenda wears socks with spiders.

If it is Wednesday, then Glenda wears shoes with buckles.

If it is Thursday, then Glenda wears shoes with bows.

If it is Friday, then Glenda wears socks with stars.

If it is Saturday, then Glenda wears socks with polka dots.

If it is Sunday, then Glenda wears shoes with shoelaces.

Seven possible inputs give Glenda seven different wardrobe outcomes.

Witch Wardrobe If Then Conditions Unplugged Coding Scratch Coding Activity Rules

How Scratch Gets Information from the Player

Before Scratch can decide what Glenda should wear, it needs information.

That is where the Sensing blocks come in.

Scratch includes an: ask [ ] and wait block.

When that block runs, the project displays a question and gives the player a place to type an answer.

Scratch waits until the user submits that answer before continuing the script.

The response then becomes available through the: answer reporter block.

That means our program can ask:

What day of the week is it?

and then use the player’s response later in the code.

What Does the Answer Block Do?

The answer block stores the most recent response entered through an ask and wait block.

Suppose the player types:

Monday

The answer block now reports:

Monday

We can take that value and compare it with another value.

For example:

<answer = Monday>

That comparison produces a Boolean result.

Either the answer equals Monday, or it does not.

That true-or-false result can then be placed inside an if statement.

Scratch Conditional Statements Witch Wardrobe Halloween Coding

Combine User Input with a Conditional Statement

Now we can put the pieces together.

First, Scratch collects information:

ask [What day of the week is it?] and wait

Then the program evaluates the player’s answer:

if <answer = Monday> then
    [Monday wardrobe action]
end

The important part is not the socks.

It is the logic connecting the player’s input to the program’s response.

The player provides data.

Scratch evaluates that data against a condition.

The condition returns true or false.

The program responds according to the rule we wrote.

That is a complete input-decision-output process.

What Is a Boolean Condition?

A Boolean is a value that can only be one of two things:

true

or

false.

In this project:

<answer = Monday>

is a Boolean condition.

If the player typed Monday, the statement is true.

If the player typed Tuesday, Friday, pumpkin, or absolutely anything else, the statement is false.

Scratch uses hexagonal Boolean blocks because they fit into the hexagonal condition spaces inside Control blocks such as if then.

That shape is a visual clue that Scratch expects a condition that can evaluate to true or false.

The Equals Operator Makes the Comparison

There is another important piece hiding inside our conditional:

=

The equals block belongs to the Operators category in Scratch.

It compares two values.

For Witch Wardrobe, we can compare:

answer

with:

Monday

Conceptually, Scratch is evaluating:

Is the player's answer equal to Monday?

If yes, the result is true.

If no, the result is false.

This is a simple example of how operators, sensing blocks, and control blocks work together.

One Project, Several Coding Concepts

Witch Wardrobe may look like a simple Halloween dress-up activity, but several computer science concepts are working together.

User input lets the player provide information.

Sensing stores and reports that information.

Operators compare values.

Boolean logic determines whether a condition is true or false.

Conditional statements control what the program does next.

The project becomes interactive because the code responds differently depending on what the player enters.

That is very different from an animation that runs exactly the same way every time.

Explore the Finished Project Before the Code

Let kids play with Witch Wardrobe before opening the editor.

Try entering several different days.

Ask:

What changed?

What stayed the same?

Why did Glenda choose a different item?

How does the program know what day you entered?

Then deliberately type something unexpected.

Try:

Pumpkin

or:

Wednesdayyyy

What happens?

That question gives us a natural way to talk about how literal computers can be.

Why Does Spelling Matter?

Your Witch Wardrobe program expects specific text input.

If Scratch checks:

<answer = Monday>

then the user’s answer needs to match what the code expects.

A typo can cause the condition to evaluate as false.

The computer does not automatically reason:

They probably meant Monday.

It simply compares the values according to the rules in the program.

This is a great demonstration of why programmers need to think carefully about user input.

Test the Program Like a Programmer

Instead of only entering correct answers, deliberately test the edges of the program.

Try:

  • Monday
  • monday
  • MONDAY
  • Mon
  • Monda
  • Pumpkin
  • An empty answer

Does every version behave the same way?

If not, why?

This turns playing with the Scratch project into software testing.

Programmers do not only test the input they hope users will provide.

They also test unexpected input.

What Happens When the Condition Is False?

An if then block only defines what happens when the condition is true.

Suppose the code says:

if <answer = Monday> then
   [wear striped socks]
end

If the answer is Tuesday, Scratch simply skips the Monday instructions.

That does not mean Tuesday is an error.

It means that particular condition is false.

The project can continue and check another condition.

Check Multiple Conditions

Glenda has seven wardrobe rules, so the program needs to distinguish among multiple possible answers.

Conceptually, it can ask:

Is the answer Monday?

If not:

Is the answer Tuesday?

Then Wednesday.

Then Thursday.

And so on.

Each test evaluates independently as true or false.

This gives kids a much better understanding of conditionals than seeing a single isolated if block.

Real programs usually need to handle more than one possible situation.

If/Then Versus If/Then/Else

Once kids understand a basic if statement, introduce if then else.

An if then else structure defines behavior for both possible outcomes.

For example:

if <answer = Monday> then
    say [Striped socks!]
else
    say [Not Monday!]
end

Now Scratch always has something to do.

If the condition is true, it uses the first branch.

If it is false, it uses the else branch.

This creates a two-way decision.

Build a Decision Tree

We can extend that idea to several possible answers.

Imagine:

Is it Monday?

If yes → striped socks.

If no → check Tuesday.

Is it Tuesday?

If yes → spider socks.

If no → check Wednesday.

That structure forms a decision tree.

Each question narrows down which action the program should take.

Decision trees show up everywhere in programming because programs frequently need to choose among multiple possible responses.

Add an Error Message

One improvement kids can make when remixing the project is handling unexpected answers.

For example:

if <valid day entered?> then
    choose wardrobe
else
    say [Please enter a day of the week.]
end

Now the program does not simply fail silently when someone types something unexpected.

It gives the user feedback.

That introduces another important programming concept:

good programs consider what happens when users make mistakes.

Make the Program Ignore Capitalization

More advanced Scratch coders can investigate whether they can make the program accept multiple versions of an answer.

Could the project accept:

Monday

and:

monday?

One simple approach is to test multiple possibilities with an or operator.

Conceptually:

if <<answer = Monday> or <answer = monday>> then
    [Monday action]
end

Now either comparison can make the overall condition true.

That introduces compound Boolean expressions.

Add AND Logic

The project can also become more complicated by requiring two conditions.

Maybe Glenda only wears striped socks if:

it is Monday AND it is cold.

The program could ask two questions.

Then it could evaluate something conceptually like:

if <<day = Monday> and <weather = cold>> then
    [wear striped socks]
end

Both conditions must be true.

That gives kids a reason to use the Boolean and operator rather than learning it in isolation.

Add OR Logic

What if Glenda wears her star socks on Friday or Saturday?

Now either condition is enough.

if <<answer = Friday> or <answer = Saturday>> then
   [wear star socks]
end

Only one side needs to be true for the entire expression to evaluate as true.

That lets kids experiment with how changing Boolean logic changes program behavior.

Remix the Witch Wardrobe Rules

Once kids understand the original project, change it.

Maybe Glenda is tired of her weekly wardrobe.

Create completely new conditions.

For example:

If it is raining, wear boots.

If it is snowing, wear a scarf.

If it is sunny, wear sunglasses.

Or ask the user for a Halloween creature:

If ghost → white costume.

If vampire → cape.

If cat → ears and tail.

If skeleton → bones.

The theme can change completely while the conditional structure remains the same.

Turn Witch Wardrobe Into a Weather Program

Instead of asking for the day of the week, ask:

What is the weather?

Then build conditions around:

  • Rain
  • Snow
  • Sun
  • Wind
  • Cold
  • Heat

Now the project starts resembling a simple recommendation program.

The same if logic can solve a completely different problem.

That helps kids recognize that coding concepts are reusable.

Turn It Into a Quiz

The same ask, answer, comparison, and conditional structure can create a quiz.

Ask:

What is 5 + 7?

Then test:

if <answer = 12> then
    say [Correct!]
else
    say [Try again!]
end

The Halloween wardrobe is just one application of a much broader programming pattern.

Debug the Witch Wardrobe

Breaking code intentionally is one of my favorite ways to teach coding.

Change:

Monday

to:

Mondey

What happens?

Delete one of the conditions.

What happens on that day?

Change the wardrobe action under Tuesday so it performs Wednesday’s action.

Does the program still run?

Yes.

Is it logically correct?

No.

That distinction is important.

A program can run without crashing and still contain a logic bug.

Syntax Errors and Logic Errors

Scratch prevents many traditional syntax errors because blocks only fit together in certain ways.

That does not prevent bad logic.

If we tell Scratch:

If Monday, wear Tuesday’s spider socks

Scratch will happily follow that instruction.

The computer did not make a mistake.

The programmer gave it the wrong rule.

That is one reason debugging is so central to coding.

Create Your Own Conditional Coding Challenge

Challenge kids to create a Scratch project with:

  • One ask and wait block
  • The answer reporter
  • At least three possible inputs
  • At least three conditions
  • A different response for each condition
  • One response for unexpected input

The topic can be anything.

Food.

Animals.

Weather.

Sports.

Books.

Halloween characters.

The important part is the program logic.

Read the Code Like a Sentence

When kids struggle with Scratch conditionals, read the blocks aloud.

For example:

If the answer equals Monday, then perform the Monday wardrobe action.

Then ask:

What is the condition?

answer = Monday

What happens when it is true?

The Monday action runs.

What happens when it is false?

Scratch skips that action.

Reading blocks as language helps kids see that the code represents a set of logical instructions rather than a pile of colored shapes.

Connect Witch Wardrobe to the Unplugged Worksheet

The Witch Wardrobe Scratch project pairs with our Halloween Conditional Code Worksheet.

The worksheet lets kids practice if/then reasoning away from the computer first.

Then Scratch makes that same reasoning executable.

On paper:

IF it is Monday, THEN choose striped socks.

In Scratch:

if <answer = Monday> then
    [Monday wardrobe action]
end

The idea did not change.

Only the way we represented it changed.

That connection between unplugged coding and executable code is exactly why I like using both approaches together.

Questions to Ask While Kids Code

Try asking:

  • What information does the program need?
  • Where does the player’s answer get stored?
  • What is the condition?
  • When does that condition become true?
  • What happens when it is false?
  • Why does spelling matter?
  • Can more than one condition be true?
  • What happens with an unexpected answer?
  • How could we improve the program?
  • What new rules could we add?

Kids should be able to explain the logic rather than simply reproduce the blocks.

What Kids Learn from Witch Wardrobe

This Halloween Scratch activity introduces:

  • Conditional statements
  • if then
  • if then else
  • Boolean values
  • Comparison operators
  • User input
  • ask and wait
  • The answer reporter
  • Logical reasoning
  • Decision trees
  • Testing
  • Debugging

More importantly, kids see how several simple blocks work together to create a program that reacts differently depending on what the user does.

That is a major transition from making Scratch animate to making Scratch think through programmed rules.

Remix Witch Wardrobe in Scratch

Kids do not need to build the entire project from an empty Scratch file.

Open our finished Witch Wardrobe project and click Remix.

Then change one thing.

Change a wardrobe rule.

Add another question.

Handle an invalid answer.

Use and or or.

Turn the days into weather conditions.

Add another character.

The goal is not simply to make a copy.

The goal is to understand the existing logic well enough to change it intentionally.

Open and Remix Witch Wardrobe on Scratch →

Try More Halloween Scratch Coding

Once kids understand conditional statements, our Halloween Conditional Collisions Scratch activity shows how the same if logic can respond to sprites touching each other instead of typed user input.

That project adds Sensing, loops, collision detection, nested conditionals, and broadcast messages.

You can also explore our Skeleton Dance Party and Trick-or-Treat Candy Hunt Maze Scratch projects as we build out the rest of our Halloween coding collection.

For screen-free coding, try our Candy Corn Coding Activity or crack Halloween jokes with our Binary Code Challenge.

And all of these projects belong in our collection of 31+ Halloween STEM Activities for Kids.

You Might Also Like

Halloween Conditional Code Worksheet

Practice if/then logic on paper before moving the same concepts into Scratch.

Witch wardrobe Scratch coding activity teaching if then conditional statements

Try the Halloween Conditional Coding Worksheet →

Halloween Conditional Collisions in Scratch

Use conditionals, sensing, broadcasts, and sprite collision detection to create interactive Halloween code.

Halloween Scratch coding activity demonstrating collision detection and conditional logic

Try Scratch Collision Detection →

Halloween Binary Code Challenge

Decode Halloween jokes while learning how computers represent information.

FB Binary Code Joke Cards

Try the Halloween Binary Coding Activity →

Glenda’s socks are silly.

The logic deciding which pair she wears is real computer science.

Scratch Witch Wardrobe conditional coding activity for kids with if then logic and Halloween wardrobe choices

Meet Toni, the Maker Mom behind Our Family Code

A picture of Toni, owner and content creator of OurFamilyCode.com.

Hey there, I’m Toni! I’m a software engineer and Maker Mom that finds my joy in unleashing my children’s curiosity by exploring STEAM concepts with my fantastic five!

When I’m not chasing toddlers or raising tweens, you can find me tearing things up and putting them back together over here at Our Family Code.

I am the owner and content creator of multiple educational websites designed to increase access to STEAM & STEM education with a focus on teaching computer science and coding to kids of all ages!

The logo for Steamkidactivities.com
A picture of the logo for lodeofcode.com
toni gardner logo Teach kids how conditional statements work in Scratch with our Witch Wardrobe Halloween coding activity. Kids use user input, Boolean logic, comparison operators, and if/then statements to help Glenda choose her wardrobe.
The logo for RocktheSteamTeam.org
The logo for Getmovingmama.com
The logo for Thiskidcanbake.com
our family code horizontal logo
The logo for the science kid site
The logo for Brandicionado.com

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top