Lesson Plan

Lesson: Guessing Game
Time: 50+ mins

Introduction

Let’s play a game! In this lesson, students will create an interactive quiz, use the "ask" block for user input, and use the "if-then-else" block to check the answer.

Code Blocks

  • : Ask the user a question and wait until the user responds.
  • : Return the user’s answer to the last question the program asked.
  • : Make the Actor repeat this loop until a true or false [boolean value] determines when the block should stop repeating the code inside it.
  • : This is a comparison operator that returns true if the first value is equal to the second value, and returns false otherwise.
  • : If the condition is true, then run the code inside the "if" section. Otherwise, run the code inside the "else" section.
  • : Make the Actor disappear from the Stage.
  • : Make the Actor appear on the Stage.

Vocabulary

  • Condition: A logical expression that evaluates to true or false
  • Conditional statement: A type of statement that executes different parts of the code based on whether a logical expression evaluates to true or false.

Objectives

Students will...
  • Use conditional statements
  • Create an interactive quiz game

Materials

  • Computers, laptops, or mobile devices (1 per student) with student account access to Tynker.com

Warm-Up (15 minutes)

Introduce your students to real-world examples of conditional statements. Pair up students and ask them to fill in the blank:
  • If it's raining outside, then ____.
  • If ______, then I will go to soccer practice.
  • If I have a quiz on Friday, then _____.
See if they can come up with other real-world examples of conditional statements!

Activities (45 minutes)

Facilitate as students complete all Guessing Game modules on their own:
1. Asking Questions Example (Example)
  • Students will view a project of an alien asking questions. Students will need to manually type in their answer at the bottom the the screen.
  • Tell students to click the red button to move on to the next module.
2. Asking Questions (DIY)
  • In this DIY (do-it-yourself) project, students will follow step-by-step directions to program an alien Actor to ask a question and repeat the answer!
  • This module introduces the "answer" variable, which is set whenever the user provides an answer to an "ask" block. Here, the "answer" variable is used to make the alien say he loves your favorite food.
  • Did students finish early? Encourage them to make the alien ask more questions.
3. Guessing Game Example (Example)
  • Students will view a guessing game project where an alien asks the user to guess its number! Students will need to manually type in their answer at the bottom the the screen.
4. Guessing Game (DIY)
  • In this DIY project, students will program a guessing game, similar to the one they viewed in the previous module.
  • Activities include programming the alien to ask a question with answer options, and making the alien respond different to correct and incorrect answers.
  • Explain to your students that the "answer" variable gains a new value every time the question is answered--the computer only "remembers" the last value they typed!
5. Find the Hidden Treasure (Puzzle)
  • In solve this puzzle module, students will need to program the spaceship to navigate!
  • Give a hint: Tell students to include negative values (e.g., "-10").
6. Create a Quiz Example (Example)
  • This module will demonstrate asking a question in Tynker and checking the user’s response. The context provided is a riddle.
7. Create a Quiz (DIY)
  • In this DIY project, students will apply concepts and code blocks from this lesson to create their own riddle!
  • Activities include adding a background and a character, programming the character to say a riddle, and answering the riddle.
  • Did students finish early? Direct their attention to the bonus section in "Step 11," which encourages students to make multiple Actors have a funny conversation before programming the Actor to ask a question.
8. Ghostbusters Example (Example)
  • Students will view a ghost-clicking game, which they will create their own version of in the next module!
  • Each ghost will disappear when students click (web) or tap (mobile) on them.
9. Ghostbusters (DIY)
  • In this DIY project, students will create a ghost game where the ghosts disappear when the user clicks (web) or taps (mobile) on them!
  • Did students finish early? Direct their attention to the bonus activity in "Step 4" of the tutorial.
  • Optional: Challenge your students to experiment with their code and make the ghosts come back. (Hint: Tell students to use a "show" code block)

Extended Activities (10 minutes)

Ask your students...
  • What did you enjoy about making your own question and answer programs?
  • Can you think of other ways you can use the "ask and wait" code blocks?
  • Who can give an example of a conditional statement? For example, "If it’s cold outside, then I will wear a jacket."
  • True or false: The phrase, "I like to wear my jacket" is an example of a conditional statement. (False)

U.S. Standards

  • CCSS-Math: MP.1
  • CCSS-ELA: RF.1.1, RF.2.4, RF.2.4.A, RF.3.4.A, RF.4.4.A, RI.2.6
  • CSTA: 1B-AP-10, 1B-AP-11, 1B-AP-15
  • CS CA: 3-5.AP.12, 3-5.AP.13, 3-5.AP.17
  • ISTE: 1.c, 1.d, 4.d, 5.c, 5.d, 6.b
This course is not part of your plan. Please upgrade to view all answer keys

Class Presentations

These student-facing slide presentations help educators seamlessly run Tynker lessons in a virtual or physical classroom setting. Each lesson has its own set of slides that introduce the big ideas, suggest unplugged activities, and include a section for each activity module. While running lesson slides, you can switch back and forth between the activity, the slides, answer keys and other lesson materials.
A sample slide presentation is available for your review. Please log in to view all the class presentations available with your plan..
Lesson 1
Introduction
27 Slides
Lesson 2
Loops and Animation
19 Slides
Lesson 3
Creating a Scene
21 Slides
Lesson 4
Jumping over Obstacles
20 Slides
Lesson 5
Storytelling
23 Slides
Lesson 6
User Interaction
19 Slides
Lesson 7
Guessing Game
22 Slides
Lesson 8
Rotation
20 Slides
Lesson 9
Alien Invaders
17 Slides
Lesson 10
Music and Animation
18 Slides
Lesson 11
Instruments and Tempo
19 Slides
Lesson 12
Broadcasting Messages
18 Slides
Lesson 13
Time Limits
17 Slides
Lesson 14
Message Driven Programming
18 Slides
Lesson 15
Pop the Balloon
18 Slides
Lesson 16
Animation with Movement
18 Slides
Lesson 17
Obstacle Course
19 Slides