9.5. Magic 8 Ball Tutorial and Projects (Optional)

This lesson includes both a tutorial that leads the student through the creation of a mobile version of the classic "Magic 8 Ball" game and several programming challenges that students will work in pairs to solve. The Magic 8 Ball app simulates the Magic 8 Ball game: when the user asks a question and shakes the device the app will respond with a random prediciton. The tutorial shows how to use App Inventor's Accelerometer to detect the device's motion and its Text to Speech component to convert text to speech. Two of the programming tasks involve the use of App Inventor's Clock component and can be quite challenging. A solution to those is provided in the lesson plan. In addition to promoting the enduring understanding about the importance of collaboration in designing and writing programs, this lesson also introduces an important new programming abstraction, a list, which is used to store a collection of items in the computer's memory. It thus also reinforces the enduring understanding that programming is facilitated by appropriate abstractions.

Professional Development

The Student Lesson: Complete the activities for Mobile CSP Lesson 9.5: Magic 8 Ball Tutorial and Projects.

Materials

9.5.1. Learning Activities

Estimated Length: 90 minutes

Day 1 - Magic 8 Ball Tutorial (45 minutes)

  • Hook/Motivation (10 minutes): "What is a Magic 8-Ball?" Have they ever used one? What does it do? Is it possible to make a virtual Magic 8-Ball? A Magic 8-Ball is a fortune-telling toy. Ask it a Yes or No question, shake it, and it will make a prediction.
    • Wikipedia has a nice explanation of a Magic 8-Ball.
    • The Three Stooges used a Magic 8-Ball in their "You Nazty Spy" series from the 1940s. See at the 1:00 minute mark of this video clip. (Can't find a free online version in English.)
    • Play with Ask 8 Ball, a free online version of the game.
  • Experiences and Explorations (25 minutes): Describe the student objectives for today’s lesson. In today's lesson another abstraction concept, the concept of defining a list, will be introduced. Lead the students through the Magic 8-Ball tutorial. Allow faster students to follow the tutorial on their own. If using the Magic 8-Ball Template identify new components used in this app as you discuss the design of the UI with the students and walk students through the coding of the app. You can also choose to use the Magic 8-Ball Media Only Template and create the UI from scratch with the students.
    Be sure to discuss the Accelerometer component; creating a list and how a random item from a list can be chosen. This includes identifying an empty list, a list index, and the length of list; and the Text-to-Speech component.
  • Rethink, Reflect and/or Revise (10 minutes): Have the students try to complete the interactive exercises and complete a reflection in their portfolio.

Day 2 - Magic 8 Ball Projects (45 minutes)

  • Hook/Motivation (10 minutes): Discuss possible enhancements to the Magic 8-Ball app using the Think-Pair-Share technique.
  • Experiences and Explorations (25 minutes): Students work in pairs on enhancements to Magic 8-Ball; teacher answers questions.
  • Rethink, Reflect and/or Revise (10 minutes): Students make a new entry in their portfolios. Have the students describe the modifications and enhancements that they made to the Magic 8-Ball app. Also ask the students to reflect on their programming experience. See the Magic 8-Ball mini projects solutions. Discuss what issues the students encountered while modifying the Magic 8-Ball app. Check students understanding using the interactive exercises.

9.5.2. Professional Development Reflection

Discuss the following questions with other teachers in your professional development program.

  • How does this lesson help students toward the enduring understanding that programming is facilitated by appropriate abstractions, in this case a list?
    [EU 5.3]
    ?