Please enable JavaScript to use CodeHS

CodeHS Logo
  • Products

    Products

    Explore what CodeHS has to offer for districts, schools, and teachers.

    • Coding LMS
    • Online IDE
    • CodeHS Pro
    • Computer Science Curriculum
    • Certifications
    • Professional Development

    Use Cases

    • Districts
    • Schools
    • Teachers
  • Products Explore what CodeHS has to offer for districts, schools, and teachers
    • Coding LMS
    • Online IDE
    • CodeHS Pro
    • Computer Science Curriculum
    • Certifications
    • Professional Development
    • Use Cases
      • Districts
      • Schools
      • Teachers
  • Platform
    • Assignments
      Create & configure your course assignments
    • Classroom
      Manage & organize your class with customizable settings
    • Grading
      Streamline your grading workflow.
    • Data
      Track & analyze student assessments & progress data
    • Write Code
      Write, run, & debug code all in a web-based IDE
    • Integrations
      Connect CodeHS to your district’s educational platform
  • Platform
    • Assignments
      Create & configure your course assignments
    • Classroom
      Manage & organize your class with customizable settings
    • Grading
      Streamline your grading workflow.
    • Data
      Track & analyze student assessments & progress data
    • Write Code
      Write, run, & debug code all in a web-based IDE
    • Integrations
      Connect CodeHS to your district’s educational platform
  • Curriculum

    Computer Science Curriculum

    Customizable K-12 Computer Science Curriculum

    Overview ›
    • Course Catalog
      • AP Courses
      • Interdisciplinary
      • Hour of Code
      • Spanish Courses
    • K-12 Pathways
      • Elementary
      • Middle School
      • High School
    • Standards
    • States
    • Supplemental Materials
      • Practice
      • Tutorials
      • Digital Textbooks
  • Curriculum Customizable K-12 Computer Science Curriculum
    • Course Catalog
      • AP Courses
      • Interdisciplinary
      • Hour of Code
      • Spanish Courses
    • K-12 Pathways
      • Elementary
      • Middle School
      • High School
    • States
    • Standards
    • Practice
    • Tutorials
    • Digital Textbooks
  • Professional DevelopmentPD

    Professional Development

    Online & In-Person Training for Teachers

    Overview ›
    • Online PD Courses
    • In-Person & Virtual Workshops
    • Free PD Events
    • Teacher Certification Prep
    • Microcredentials
    • PD Membership
  • Professional Development Online & In-Person Training for Teachers
    • Professional Development
    • Online PD Courses
    • In-Person & Virtual Workshops
    • Free PD Events
    • Teacher Certification Prep
    • Microcredentials
  • Online IDE

    Online IDE

    Write, Run, & Debug Code in an Online IDE

    Overview ›
    • JavaScript
    • Python
    • Java
    • HTML
    • C++
    • SQL
  • Online IDE Write, Run, & Debug Code in an Online IDE
    • Online IDE
    • JavaScript
    • Python
    • Java
    • HTML
    • C++
    • SQL
    • Karel
  • Resources
    • About
    • Privacy Center
    • Case Studies
    • States
    • Testimonials
    • Tweets
    • Read Write Code Blog
    • Coding in the Wild
    • Knowledge Base
    • Student Projects
    • Career Center
  • Resources
    • About
    • Privacy Center
    • Case Studies
    • States
    • Testimonials
    • Tweets
    • Read Write Code Blog
    • Coding in the Wild
    • Knowledge Base
    • Student Projects
    • Career Center
  • Request a Quote
  • Log In
  • Sign Up

New Sandbox Program

Click on one of our programs below to get started coding in the sandbox!

Java

JavaScript

Python 3

HTML

Karel

Turtle

View All

Example Exploring Collisions

This is an example for this lesson. You are encouraged to play around with it, run and change the code, and learn how it works. When you are done, click continue to go to the next problem.
This code has diverged from the student’s work.
Hour of Code: Collision Simulations
Finish My Hour of Code