Programming Lab 4: Building Grids for Games

Students begin a project—building a Tic Tac Toe game and other games that are played by placing marks (X or O, or a number) on a square array of tiles. This project will develop over the course of a few units. In this lab, students get as far as creating the grid, getting it automatically to fit the screen regardless of the number of tiles, and placing marks on the grid (but not yet with the computer checking to see if the moves are legal or if a player has won). In doing this, students continue to use ideas (and new levels) of abstraction, and learn also how to use a variety of math reporters—four basic operations (+, -, ×, ÷), and mod—to create new reporter blocks, functions to perform specialized calculations for them.

Pacing:

The 2 lab pages could take about 1-2 days (40-80 minutes). Expected times to complete follow:

Prepare

Students will:

Goals for the Lab:


As a Class:

Discussion/Writing Prompts 


Assignments:

Tips:

Solutions:

Correlation with AP CS Principles Framework

Enduring Understandings:

Learning Objectives:

Essential Knowledge: