Close
Close full mode
logoMakeCode AP CSP

Logic in Loops Unplugged

Materials Needed

  • Decks of cards (at least 12 cards per group)
  • Masking tape
  • Dice (1 for each group)
  • Cut out words:
    • You can create your own simple sentences, or
    • You can use the ones on this document: Simple Sentences.
  • A Sentence Puzzles page for each group. (Sentence Puzzles Word document)

Before class

  • Divide sets of cards into three piles.
  • Label the piles A, B, and C.
  • Use the masking tape to tape down different words on each card in each pile. You may choose to put the nouns, verbs, and adjectives in separate piles or you can mix them.
  • Divide up the piles so that each group gets at least 4 cards in each pile.

In class

  • Form groups of 2 to 3 students each.
  • Distribute one die to each student group. Use virtual die if that is more convenient.
  • Distribute an A, B, and C pile of cards to each group.
  • Explain this process:
    • Roll the die. The die will determine which pile to select a card from:
      • 1 or 2: take a card from pile A
      • 4: take a card from pile B
      • 6: take a card from pile C
    • If you roll a 3 or 5, roll again.
    • It is possible to take a card from one of the piles more than once.
    • Keep rolling until you have three cards.
    • When you have three cards, write a complete sentence that incorporates the words on the cards drawn. Use all 3 words. Students can use the Sentence Puzzles page to keep track of their sentences.
  • When each group has a sentence, ask groups to show the words they selected and read their sentence.
  • Repeat this steps of rolling the die, getting cards, and writing a sentence several times until the students are comfortable with the process.
  • When the students are comfortable with the process, instruct them to describe the steps of the process using the concepts and terms used when discussing loops and logic.
  • Task students to write the process in Pseudocode.
  • When students are finished, use volunteers or have each group explain the process they believe occurred.
  • Write the solution on the board that the entire group can agree upon.
Example Pseudocode:
While <3 cards
IF dice is 1 or 2 take a card from pile A
IF dice is =4: take a card from pile B
IF dice is <5: take a card from pile C
Else roll again
  • Students can use the Sentence Puzzles page to document their work together.
  • Extension: modify the game play rules to include:
    • And
    • Or
    • Not
    • If
    • Else
    • While
    • Functions
    • And functions with return value
πŸ“˜ Unit 5 - AAP Part 2 β€” Previous
Logic in Loops
Next β€” πŸ“˜ Unit 5 - AAP Part 2
Sentence Puzzles