Identify the list data pattern and apply the list data structure to improve coding efficiency.
Continuing the idea of identifying patterns to understand the why behind coding structures continues with identifying the pattern of a list/array of data, then applying the list data structure in App Inventor to increase the efficiency of code in their simple game. Students will be able to apply the list data structure to their arduino sensors.
Activity 4.6a (Budget 15 minutes)
Students identify WHEN-THEN statements in a game of UNO.
i. Select two students to come to the front of the room to play the classic game, Rock-Paper-Scissors (RPS). As a refresher...
Students engage in a battle of hand-signs to determine the first-to-three winner. Standing back-to-back, both students call out, "rock, paper, scissors... shoot", then each simultaneously throws one of the three hand-signs: the rock, the paper, or the scissors. Each student reveals their hand-sign by turning toward each other. The winner of the battle is determined by the following rules:
Rock throw beats a Scissor throw
Scissor throw beats a Paper throw
Paper throw beats a Rock throw
If both players throw the same hand-sign, the battle is a push (no winner). The first player to accumulate three battle wins is declared the winner of the match.
You may choose to only have one pair play in front of the class, have 2-3 pairs battle, or give the entire class a chance to play - this is teacher choice. The goal is to simply play a quick game, following the rules above.
Activity 4.6c (Budget 30 minutes)
Students create WHEN-THENs statements from the UNO game and rules, identifying structures that complete functions in the UNO game.
A. Students using their UNO rules sheets and this WHEN-THEN Advanced Organizer attempt to complete and create a list of WHEN-THEN statements. Some of them have been partially crafted, and others will require students to come up with the entire WHEN-THEN statement. To assist students, we've provided a key check their statements against. And this is your teacher answer key for the organizer.
WHEN-THEN Advanced Organizer (Student Resource)
Organizer Answer Key (Teacher Resource)