CODING - Grade K
Lesson
Unplugged Coding
Coding works on Logical Thinking
CODING - Grade K
Lesson
Unplugged Coding
Coding works on Logical Thinking
Definition: A condition is and exception to a rule. A conditional statement is an "if... then...." statement that changes how code is executed. d
Pairs or Group | Materials: None
"If I jump once, then you jump once!"
One partner is the leader and one is the follower.
The leader starts by giving simple instructions in the format of an If...Then...statement. For example: “If I touch my nose, then you touch your nose” or “If I jump once, then you jump once” etc. Try out a few actions.
To increase difficulty, the leader can specify outcomes that are different than the condition. For example: “If I jump once, then you jump three times” or “If i spin in a circle, then you clap your hands”.
Once the pair has come up with a few actions, the leader can perform them at random! See if the follower can keep up, without forgetting what action to perform with each direction from the leader.
Switch roles when finished.
Coding Connection: A new condition from the leader can change the action performed by the follower, just like a condition in code can change the path a computer program takes.
Individual or Pairs | Materials: Paper, drawing supplies
Come up with a rule - something that always happens in the same way. For example, “I go to school on Mondays”.
Then, come up with an exception, also known as a condition, to this rule. For example, “If it is a holiday, then I don’t go to school on Monday.” Write the conditional statement at the top of a piece of paper.
Use the rest of the paper space to illustrate the conditional statement. In this example, you could draw a picture of your favorite holiday.
Repeat this process 3 times so you have three conditional art pieces!
If working in pairs, one partner can come up with the rules, and the other can come up with the condition and draw the image. Then, switch roles.
Coding Connection: A condition is an exception to a rule. The way a program runs is based on rules and conditions, just like how real world events can change based on certain conditions too!
Pairs | Materials: None
Rock paper scissors is a hand game played between two people. At the same time, each player forms one of three shapes with an outstretched hand. These shapes are "rock" (make a fist), "paper" (flat hand), and "scissors” (make the number 2)
The winner is decided using a set of conditional statements:
First, If rock and scissors are played, then rock wins
Then, If scissors and paper are played, then scissors wins
Next, If paper and rock are played, then paper win
Finally, If the same object is played, then the round is a tie
Play three rounds. Using the conditional statements listed above, players will determine the winner of each round. Have your students complete this handout to track the conditions!
As an extension, make up brand new actions (instead of rock, paper, and scissors) and decide what conditions result in a win!
Coding Connection: The outcome of the game is determined by the conditions set before it starts. The same is true in coding, where the outcome of a computer program is determined by the conditions outlined in the code.