1 of 59

Chapter 2

Module 4: Conditionals

2 of 59

Before you teach. . .

You may want to prepare the following before you implement this module in your classroom:

  • Make a copy of the slides if you’d like to revise or adapt them for your classroom
  • Use the teacher dashboard to check student progress.
  • Review Concept Check activities
  • Navigate to Independent Practice slides to:
    • Unlock specific modules and levels as necessary
    • Review extension activities and have activity links ready to share
  • Try out some practice levels on your own
  • Review the solution guide

3 of 59

How to teach a lesson. . .

  • Use the first section of the lesson slides (up to Independent Practice slide) to introduce the new concept for that lesson
  • If applicable, watch any Cutscene videos as a whole class to introduce the story line
  • Extension Activities are found in the speaker notes of the Independent Practice slide. You can use them to differentiate pacing for fast finishers or for students who need reinforcement.
  • Have students independently play through the suggested levels on the Independent Practice slide
    • This section which will also include Cinematics and Concept Checks
  • Use the Check-In section as an opportunity for students to reflect on what they have learned in the lesson

4 of 59

Table of Contents

Lessons

Explorations

Additional Resources

5 of 59

Module 4

Lesson 1

Introduction to Conditionals

6 of 59

What did we learn last time?

-What are variables?

-How did you use variables in Ozaria?

-What’s the difference between strings & numbers?

-How did you use findNearestFriend in Ozaria?

7 of 59

Today’s Journey

Warm-Up: Conditionals

Explore using Pseudocode

Play Ozaria: Explore the city of Xing’Chen

Optional Extension: Design a Level

8 of 59

Conditionals

9 of 59

Conditionals

If

Then

condition

action

We use conditionals to help us plan and make decisions. We check a condition to see if it’s true or false. If the condition is true, then we perform an action.

It is raining.

Bring an umbrella!

10 of 59

Conditionals

condition

indented

action

Programs use conditionals to make decisions. This allows you to use the same program even if conditions change.

IF there is a RIVER

hero jumpRight

IF there is NO RIVER

hero moveRight

11 of 59

Concept Check: Conditionals

Fill out the table using pseudocode

IF

Condition

THEN

Action

There is a door

Use the door

There is a pit

Jump over the pit

IF there is a DOOR

hero USES DOOR

�IF [condition]

[action]

12 of 59

Independent Practice

13 of 59

Independent Practice

Play Ozaria

Start with Cinematic: Welcome to the City�and stop after you finish Challenge Level: The Suspect

Extension Activity: Design a Map

Use the link provided by your teacher to complete this�activity.

Need Help?Always try it once & try using the troubleshooting guide first. If you still need help after that, then reach out to a classmate or the teacher.

14 of 59

Check-In

15 of 59

What did you discover?

Chapter 2, Module 4, Lesson 1

What I did:

-How far did you get in Ozaria? What was your favorite part?

What I noticed:

-What did you notice as you played through the game?

-Did you discover or learn something new?

What was challenging?�-Was something confusing about the story or the levels?

-Do you need more practice on a specific part of the code or the game?

16 of 59

Module 4

Lesson 2

Comparators & Conditionals

17 of 59

What did we learn last time?

-What are conditionals?

-How did you use conditionals in Ozaria?

-What’s pseudocode?

-How happened in the story of Ozaria?

18 of 59

Today’s Journey

Warm-Up: Comparators & Conditionals

Exploring Flowcharts & Conditionals

Play Ozaria: Explore the city of Xing’Chen

Optional Extension: Design a Conditional Card Game

19 of 59

Comparators & Conditionals

20 of 59

Comparators

How do we use comparators in math?

Is 3 < 5?

Is 3 > 5?

21 of 59

Comparators & Conditionals

comparator condition

IF distance to enemy < 4

Comparators can be used in conditionals too

hero moveRight

TRUE

FALSE

hero sneakRight

22 of 59

Comparators & Conditionals

Only happens if distance < 4

Only happens if distance > 4

Will always happen after the hero sneaks right or moves right

TRUE

FALSE

The way conditionals work is a little more complicated...

IF distance < 4

hero sneakRight

IF distance > 4

hero moveRight

hero jumpRight

IF distance to enemy < 4

hero moveRight

TRUE

FALSE

hero sneakRight

IF distance to enemy > 4

hero jumpRight

23 of 59

Concept Check: Comparators

Let’s play a card game using comparators and conditionals!

Draw a Card

card = get VALUE of CARD

IF card < 7

Player A gets 1 POINT

�IF [condition]

[action]

TRUE

FALSE

IF card value < 7

1 point for Player B

TRUE

FALSE

1 point for Player A

IF card value > 7

Player A or B draws a card

Card Values

- Ace = 1

- 2-10 = 2-10

- Jack = 11

- Queen = 12

- King = 13

Go back to the beginning of the diagram.

24 of 59

Independent Practice

25 of 59

Independent Practice

Play Ozaria

Start with Intro: The Thief�and stop after you finish Cinematic: Fighting Back

Extension Activity: Design a Conditional Card Game

Use the link provided by your teacher to complete this�activity.

Need Help?Always try it once & try using the troubleshooting guide first. If you still need help after that, then reach out to a classmate or the teacher.

26 of 59

Check-In

27 of 59

What did you discover?

Chapter 2, Module 4, Lesson 2

What I did:

-How far did you get in Ozaria? What was your favorite part?

What I noticed:

-What did you notice as you played through the game?

-Did you discover or learn something new?

What was challenging?�-Was something confusing about the story or the levels?

-Do you need more practice on a specific part of the code or the game?

28 of 59

If/Else Conditionals

Module 4

Lesson 3

29 of 59

What did we learn last time?

-What are comparators?

-How did you use flowcharts to plan out conditionals?

-How did you use comparators and conditionals in Ozaria?

-How happened in the story of Ozaria?

30 of 59

Today’s Journey

Warm-Up: If/Else Conditionals

Exploring Flowcharts & If/Else Conditionals

Play Ozaria: Defeat enemies with new spells

Optional Extension: Design a Conditional Story

31 of 59

If/Else Conditionals

32 of 59

If/Then Conditionals

How did we use a flowchart to map these conditionals?

TRUE

FALSE

IF distance to enemy < 4

hero moveRight

TRUE

FALSE

hero sneakRight

IF distance to enemy > 4

hero jumpRight

33 of 59

If/Else Conditionals

If/Then

If/Else

What do you notice is different between the two flowcharts?

IF distance to enemy < 4

TRUE

ELSE

hero sneakRight

hero jumpRight

hero moveRight

TRUE

FALSE

IF distance to enemy < 4

hero moveRight

TRUE

FALSE

hero sneakRight

IF distance to enemy > 4

hero jumpRight

34 of 59

If/Then

If/Else

Programming Tips

We are always looking for new ways to make our code faster, efficient, and error proof.

We achieve this with structured programming.

Structured programming uses reusable elements, like variables, to make a program clearer and easy to update.

With regular programming, although it requires less planning ahead, a program is prone to errors and hard to update.

Structured

Regular

TRUE

FALSE

IF distance to enemy < 4

hero moveRight

TRUE

FALSE

hero sneakRight

IF distance to enemy > 4

hero jumpRight

IF distance to enemy < 4

TRUE

ELSE

hero sneakRight

hero jumpRight

hero moveRight

35 of 59

If/Else Conditionals

If/Then

If/Else

Only happens if distance < 4

ELSE this happens if the condition is false

Will always happen after the hero sneaks right or moves right

Let’s see how if/else conditionals work in pseudocode

IF distance < 4

hero sneakRight

ELSE

hero moveRight

hero jumpRight

IF distance < 4

hero sneakRight

IF distance > 4

hero moveRight

hero jumpRight

36 of 59

Concept Check: If/Else Conditionals

Let’s choose our own adventure using if/else conditionals!

hero enters cave

IF afraid of the dark

hero lightsTorch�ELSE

[action]

You enter a cave

IF you are afraid of the dark

TRUE

ELSE

TRUE

A bear shows up and chases you out of the cave!

You keep going and find a treasure chest.

ELSE

You light a torch

You call out “Hello?”

Nothing happens so you go deeper into the cave.

IF you start singing

37 of 59

If/Else Conditionals

Python

JavaScript

The syntax of if/else conditionals is quite similar to if/then conditionals. Remember where to use indentations and colons/braces!

if distance < 4:

hero sneakRight()

else:

hero moveRight()

hero jumpRight()

if (distance < 4){

hero sneakRight();

}else{

hero moveRight;

}

hero jumpRight;

38 of 59

Independent Practice

39 of 59

New Earth Spells

The two earth spells let you defeat enemies, whether they’re near or far.

enemy = findNearestEnemy

distance = getDistanceTo(enemy)

IF distance < 3

hero castEarthWave

hero sneakRight 2

ELSE

hero castEarthPit(enemy)

hero moveRight 1

40 of 59

Independent Practice

Play Ozaria

Start with Cinematic: Conditional Casting�and stop after you finish Cinematic: The Truth

Extension Activity: Design a Conditional Story

Use the link provided by your teacher to complete�This activity.

Need Help?Always try it once & try using the troubleshooting guide first. If you still need help after that, then reach out to a classmate or the teacher.

41 of 59

Check-In

42 of 59

What did you discover?

Chapter 2, Module 4, Lesson 3

What I did:

-How far did you get in Ozaria? What was your favorite part?

What I noticed:

-What did you notice as you played through the game?

-Did you discover or learn something new?

What was challenging?�-Was something confusing about the story or the levels?

-Do you need more practice on a specific part of the code or the game?

43 of 59

Module 4, Lesson 4

Explorations

Computing Systems:

How Computing Systems Work

44 of 59

Recall the Acodus. How does the Acodus work?

�What are the different components of your computer?

What do each of these components do?

Computing Systems

45 of 59

Computing Systems

Recall the different parts of a computer system. Think about a chromebook.

Computer System Schematic

Input (includes sensors)

Output

Processor

Memory

Input -- keyboard, trackpad, microphone, video camera

Processor -- internal device which executes instructions

Memory -- internal device that stores information

Output -- visible elements displayed on the screen, audio sounds from the speakers

46 of 59

Computing Systems

Now let’s think about the Acodus. Can you identify the different components?

hero.moveLeft()

hero.moveUp()

hero.moveRight()

hero.use("door")

Computer System Schematic

Input (includes sensors)

Output

Processor

Memory

47 of 59

Humans vs Computers

How do humans and computers compare? What are some examples?

Input

Processor

Memory

Output

Human

Computer

48 of 59

Humans vs Computers

Let’s compare how humans and computers function.

Input

Processor

Memory

Output

Human

5 primary senses (sight, hearing, touch, taste, & smell)

The human brain

Memory

Speech, writing, gestures, actions, reactions

Computer

Devices like a keyboard, mouse, touchscreen, camera, & microphone

CPU

Storage devices like hard drives, solid-state drives, & memory chips

Screens & speakers

49 of 59

Discuss

What kinds of tasks are humans best at?

-Why?

What kinds of tasks are computers best at?

-Why?

50 of 59

Humans + Computers

For some tasks, humans and computers need to work together.

We refer to really large datasets as Big Data.

These datasets present challenges when processing and drawing conclusions from so much data.

Big Data

51 of 59

Explore

  1. Choose a device to research.

  • Draw a diagram to show how the computing system of this device works.

  • Make sure to clearly label/describe important components (input, output, software, hardware, processor, memory, ect).

52 of 59

Share

Let’s show the class what you discovered!

53 of 59

Resources

Standards Alignment & Additional Resources

54 of 59

CSTA Standards Alignment

Computing Systems

-1B-CS-01: Describe how internal and external parts of computing devices function to form a system.

-2-CS-03: Systematically identify and fix problems with computing devices and their components

Algorithms & Programming

-1A-AP-15: Using correct terminology, describe steps taken and choices made during the iterative process of program development.

-1B-AP-10: Create programs that include sequences, events, loops, and conditionals.

-1B-AP-11: Decompose (break down) problems into smaller, manageable subproblems to facilitate the program development process.

-1B-AP-12: Modify, remix, or incorporate portions of an existing program into one's own work, to develop something new or add more advanced features.

-1B-AP-15: Test and debug (identify and fix errors) a program or algorithm to ensure it runs as intended.

-2-AP-10: Use flowcharts and/or pseudocode to address complex problems as algorithms.

-2-AP-13: Decompose problems and subproblems into parts to facilitate the design, implementation, and review of programs.

55 of 59

Common Core State Standards

Reading: Informational Text

-CCSS.ELA-LITERACY.RI.6.2: Determine a central idea of a text and how it is conveyed through particular details; provide a summary of the text distinct from personal opinions or judgments.

-CCSS.ELA-LITERACY.RI.6.7: Integrate information presented in different media or formats (e.g., visually, quantitatively) as well as in words to develop a coherent understanding of a topic or issue.

-CCSS.ELA-LITERACY.RI.6.10/CCSS.ELA-LITERACY.RI.7.10/: By the end of the year, read and comprehend literary nonfiction in the grades 6-8 text complexity band proficiently, with scaffolding as needed at the high end of the range.

-CCSS.ELA-LITERACY.RI.7.2/CCSS.ELA-LITERACY.RI.8.2: Determine two or more central ideas in a text and analyze their development over the course of the text; provide an objective summary of the text.

-CCSS.ELA-LITERACY.RI.7.3: Analyze the interactions between individuals, events, and ideas in a text (e.g., how ideas influence individuals or events, or how individuals influence ideas or events).

Writing

-CCSS.ELA-LITERACY.W.6.6: Use technology, including the Internet, to produce and publish writing as well as to interact and collaborate with others; demonstrate sufficient command of keyboarding skills to type a minimum of three pages in a single sitting.

-CCSS.ELA-LITERACY.W.6.7: Conduct short research projects to answer a question, drawing on several sources and refocusing the inquiry when appropriate.

56 of 59

Common Core State Standards

Writing (continued)

-CCSS.ELA-LITERACY.W.6.10/CCSS.ELA-LITERACY.W.7.10/CCSS.ELA-LITERACY.W.8.10: Write routinely over extended time frames (time for research, reflection, and revision) and shorter time frames (a single sitting or a day or two) for a range of discipline-specific tasks, purposes, and audiences.

-CCSS.ELA-LITERACY.W.7.4/CCSS.ELA-LITERACY.W.8.4: Produce clear and coherent writing in which the development, organization, and style are appropriate to task, purpose, and audience.

-CCSS.ELA-LITERACY.W.7.6: Use technology, including the Internet, to produce and publish writing and link to and cite sources as well as to interact and collaborate with others, including linking to and citing sources.

-CCSS.ELA-LITERACY.W.7.7: Conduct short research projects to answer a question, drawing on several sources and generating additional related, focused questions for further research and investigation.

-CCSS.ELA-LITERACY.W.7.8/CCSS.ELA-LITERACY.W.8.8: Gather relevant information from multiple print and digital sources, using search terms effectively; assess the credibility and accuracy of each source; and quote or paraphrase the data and conclusions of others while avoiding plagiarism and following a standard format for citation.

-CCSS.ELA-LITERACY.W.8.6: Use technology, including the Internet, to produce and publish writing and present the relationships between information and ideas efficiently as well as to interact and collaborate with others.

Speaking & Listening

-CCSS.ELA-LITERACY.SL.6.1/CCSS.ELA-LITERACY.SL.7.1/CCSS.ELA-LITERACY.SL.8.1: Engage effectively in a range of collaborative discussions (one-on-one, in groups, and teacher-led) with diverse partners on grade 6-8 topics, texts, and issues, building on others' ideas and expressing their own clearly.

57 of 59

Common Core State Standards

Speaking & Listening (continued)

-CCSS.ELA-LITERACY.SL.6.4: Present claims and findings, sequencing ideas logically and using pertinent descriptions, facts, and details to accentuate main ideas or themes; use appropriate eye contact, adequate volume, and clear pronunciation.

-CCSS.ELA-LITERACY.SL.6.6/CCSS.ELA-LITERACY.SL.7.6/CCSS.ELA-LITERACY.SL.8.6: Adapt speech to a variety of contexts and tasks, demonstrating command of formal English when indicated or appropriate.

-CCSS.ELA-LITERACY.SL.7.4/CCSS.ELA-LITERACY.SL.8.4/: Present claims and findings, emphasizing salient points in a focused, coherent manner with pertinent descriptions, facts, details, and examples; use appropriate eye contact, adequate volume, and clear pronunciation.

58 of 59

Common Core State Standards

Math: Expressions & Equations

-CCSS.MATH.CONTENT.6.EE.B.6: Use variables to represent numbers and write expressions when solving a real-world or mathematical problem; understand that a variable can represent an unknown number, or, depending on the purpose at hand, any number in a specified set.

-CCSS.MATH.CONTENT.6.EE.B.8: Write an inequality of the form x > c or x < c to represent a constraint or condition in a real-world or mathematical problem. Recognize that inequalities of the form x > c or x < c have infinitely many solutions; represent solutions of such inequalities on number line diagrams.

-CCSS.MATH.CONTENT.7.EE.B.4: Use variables to represent quantities in a real-world or mathematical problem, and construct simple equations and inequalities to solve problems by reasoning about the quantities.

59 of 59

Resource Links