Lesson Planet
Search educational resources
  • Sign In Try It Free
  • AI Teacher Tools
    • Discover Resources Search reviewed educational resources by keyword, subject, grade, type, and more
    • Curriculum Manager (My Content) Manage saved and uploaded resources and folders To Access the Curriculum Manager Sign In or Join Now
    • Browse Resource Directory Browse educational resources by subject and topic
    • Curriculum Calendar Explore curriculum resources by date
    • Lesson Planning Articles Timely and inspiring teaching ideas that you can apply in your classroom
    • Our Story
    • Frequently Asked Questions
    • Testimonials
    • Contact Us
  • Pricing
  • School Access
    • Your school or district can sign up for Lesson Planet — with no cost to teachers
      Learn More
  • Sign In
  • Try It Free

Hi, what do you want to do?

Create a lesson plan
Create a lesson plan
Generate resources with 80+ AI teacher tools
Generate resources with 80+ AI teacher tools
Search 200,000 instructional videos
Search 200,000 instructional videos
Find a teaching resource
Find a teaching resource
Project: Magic 8-Ball InteractiveProject: Magic 8-Ball Interactive
Publisher
Khan Academy
Resource Details
Curator Rating
Educator Rating
Not yet Rated
Grade
6th - Higher Ed
Subjects
STEM
1 more...
Resource Types
Activities & Projects
1 more...
Audiences
For Teacher Use
1 more...
Duration
30 mins
Instructional Strategies
Guided Practice
2 more...
Usage Permissions
Creative Commons
BY-NC-SA: 3.0
cc
Interactive

Project: Magic 8-Ball

Curated and Reviewed by Lesson Planet
This Project: Magic 8-Ball interactive also includes:
  • JavaScript Guide
  • Student Reference
  • Join to access all included materials

Your student programmers will enjoy creating their own Magic 8-ball in this JavaScript activity. This a great opportunity to practice using if and else statements based on randomly generated numbers. What will you ask the 8-ball? 

3 Views 2 Downloads

Concepts

javascript, computer code, Computer Programming, coding, computer drawing, animation

Additional Tags

programming in javascript, drawing and animation coding

Pros

  • Allows students to add their creative flare into the different answers revealed by the 8-ball 
  • The results from changes in code are immediately displayed so coders can develop a deeper understanding of their code
  • Simple, easy-to-follow steps are broken down to help a variety of learners
  • Students who want to explore and advance on their own are free to try other options and learn by experimenting independently

Cons

  • None

See similar resources:

Lesson Plan

Star Wars: Building a Galaxy with Code

Code.org
Welcome to the code side. The interactive lesson introduces coding in a game format with familiar characters. Young computer experts learn to develop code to control the interaction of the characters in the game. The activity ends with...
3 mins 6th - 12th STEM
Instructional Video

Logical Operators, Computer Programming

Khan Academy
As the author in this video states, "Life is complex." To handle this complexity, programming languages use something called Boolean operators. In a simple JavaScript code example, this video shows how to set up a conditional statement...
5 mins 6th - Higher Ed STEM
Instructional Video

Learn to Code: Understanding Functions and Making a Guessing Game

Lifehacker
Here's where it all comes together. Using the skills learned in the previous three videos, the final installment of this series on JavaScript explores how to create functions. By the end of the video, young programmers will be able...
8 mins 9th - Higher Ed STEM
CCSS: Adaptable
Instructional Video

More on Variables

Khan Academy
Variables represent one of the most fundamental features in any programming language. The easy-to-follow explanation given in this video focuses on the difference between variables and values. Specifically, the author looks at how...
4 mins 6th - Higher Ed STEM
Instructional Video

If Statements, Computer Programming

Khan Academy
This video continues the Khan Academy tutorials and activities on writing code in JavaScript. Here, we are introduced to the conditional if statement. The result is a cute program that produces a bouncing ball. Your young programmers...
4 mins 6th - Higher Ed STEM
Instructional Video

Booleans, Computer Programming

Khan Academy
As one accumulates more life experiences, there are fewer and fewer things that are strictly one thing or another. There always seems to be some gray area or middle ground. Not so with Boolean data types! We are in a world of only two...
7 mins 6th - Higher Ed STEM
Interactive

Challenge: Bouncy Ball

Khan Academy
Create your own bouncing ball program with this guided activity. Java Script code that sends a ball down the screen is provided. The task is to fix the code to make it bounce up when it hits the bottom of the screen and then down again...
6th - Higher Ed STEM
Interactive

Challenge: Flashy Flash Card

Khan Academy
Create your own flash card in this JavaScript coding activity. Modify the given code so that the answer is revealed when the mouse is pressed. Provides good practice of conditional if-else statements.
6th - Higher Ed STEM
Interactive

Challenge: Tasty Tomato

Curated OER
Take a big bite out of the red tomato by practicing your use of the variables mouseX and mouseY in a JavaScript coding task. The activity will guide you step-by-step and will help young coders understand how to draw objects based on the...
2 mins 6th - Higher Ed STEM
Interactive

Challenge: Simple Shapes!

Khan Academy
Now practice drawing a rectangle, ellipse, circle, and line by writing your own JavaScript code. Don't know where to start? No problem, you will be guided through creating every line of code. Getting an error message? Again, no problem,...
6th - Higher Ed STEM
Try It Free
© 1999-2026 Learning Explorer, Inc.
Teacher Lesson Plans, Worksheets and Resources

Sign up for the Lesson Planet Monthly Newsletter

Open Educational Resources (OER)

  • Health
  • Language Arts
  • Languages
  • Math
  • Physical Education
  • Science
  • Social Studies
  • Special Education
  • Visual and Performing Arts
View All Lesson Plans

Discover Resources

  • Our Review Process
  • How it Works
  • How to Search
  • Create a Collection

Manage Curriculum

  • Edit a Collection
  • Assign to Students
  • Manage My Content
Contact Us Site Map Privacy Policy Terms of Use