Skip to content

Latest commit

 

History

History
72 lines (46 loc) · 2.28 KB

File metadata and controls

72 lines (46 loc) · 2.28 KB

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.
  • 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 final project specs and thinking about how they will apply what they have learned this unit to complete the project.