Skip to main content
What are Conditional Statements?

A conditional statement in coding uses an “if-then” format to make decisions.

Jon Mattingly avatar
Written by Jon Mattingly
Updated over 2 months ago

What are Conditionals?

Conditionals are “if-then” statements that determine how code is executed. They’re a key part of decision-making in programming, allowing us to control every action a computer performs. Once a computer follows a set of commands in order, we can add conditions to change its behavior based on different situations.

Conditionals in Kodable Basics

Students are introduced to conditionals on planet Smeeborg. In Kodable, they use colored tiles as conditions to change their Fuzz’s path.

In the example below, the code reads: “At the green tile, turn left.” This prevents the Fuzz from continuing straight and instead guides it to collect the two stars before completing the maze.

Conditionals in Kodable Creator

Conditionals are covered in the final course, Key Quest. Here, students learn how to use condition statements that allow a program to take different actions depending on whether a specific condition is true or false.

In the example below, if the character has a key, the game performs one action; if not, it performs another. This helps students understand how to create more interactive gameplay.

Real-Life Example

As people, we can think about situations and make decisions based on what we observe or know to be true. For example, “If it is raining out, then we will have recess inside.” Or “If it is my birthday, then I can have a birthday cake.” Conditions are cause and effect: “If this, then that.”

Did this answer your question?