2nd Semester Intro to Computer Science

Lesson 2.06: Game Loop

Learning Objectives

Students will be able to…

  • Define and identify: while loop
  • Use a while loop to simulate game play

Materials/Preparation

Pacing Guide

Duration Description
5 Minutes Do Now
10 Minutes Lesson
35 Minutes Lab
5 Minutes Debrief

Instructor’s Notes

1. Do Now

  • Students experiment with creating while loops.

2. Lesson

Instruction

  • Ask students what the while loops that they created did.
  • Go over the syntax of while loops. Use this as an opportunity to remind students of boolean expressions.

Discussion

  • Ask: how might while loops be useful?
  • Ask students to consider how they could write a loop using user input, using the following scenario:
  • What if you wanted the loop to stop when the user inputs “quit”?

Activity

  • Have the students think about and write a solution

Student Share

  • call students up to the board to write out how they solved it.

3. Lab

  • Students work to create a Tic-Tac-Toe game that allows turns (up to 9), building on their previous work.

4. Debrief

  • Check for completion and understanding of the lab.

Accommodation/Differentiation

If there is extra time, have students start reading through the project specs and thinking about how they will apply what they have learned this unit to complete the project.

Forum discussion

Lesson 2:06: Game Loop (TEALS Discourse Account Required)

Edit this page Report an issue