JS coding practice Exercises for AP Computer Science

JS coding practice Exercises for AP Computer Science
Grade Levels
Resource Type
Product Rating
File Type

Compressed Zip File

Be sure that you have an application to open this file type before downloading and/or purchasing.

443 KB
Product Description

What's in these exercises?

Two games, Minesweeper and Battleship with partially completed JS code and available freely through my github(and added as separate zip files in this resource as well). THEY ARE NOT FULL MULTIPLAYER GAMES, Instead just the most important functions of those games that need to be completed by the students. The exercises are divided into tasks (I only coded up 2 exercises for each task and I might be adding more in the future). Github links:

Battleship Task 1

Battleship Task 2

Minesweeper Task 1

Minesweeper Task 2


Access to a JS runtime that can run arbitrary functions and a console to print messages. I had initially designed it to run in the coding pad of code.org's AP CS class.

What is the purpose of these exercises?

To teach basic concepts of looping, conditional logic and arrays.

Why do you not add complete games?

I might well do so. However a full game is more like a term project and the purpose is for the kids to be able to read, complete and debug real code, a useful skill in Programming.

How do I use these?

You can copy paste the exercises to coderpad complete the sections that are incomplete and run them. Once the code is complete you can run the script in your JS environment. This runs some tests and prints output.

Total Pages
Answer Key
Teaching Duration
Report this Resource
Digital Download
More products from Sidharth Gupta
Product Thumbnail
Product Thumbnail
Product Thumbnail
Product Thumbnail
Product Thumbnail
Teachers Pay Teachers

Teachers Pay Teachers is an online marketplace where teachers buy and sell original educational materials.

Learn More

Keep in Touch!

Sign Up