This page was created with the assistance of GPT-5.6 Sol.
Values
This is the first programming concept that student learns. The prerequisites are omitted. Any difficulty in understanding would come from a lack of vocabulary due to age or the lack of engagement of innate intuition.
Why Values Are the First Thing You Understand
There is no way to directly represent what a value is in any programming language. One might say that in programming language X, I can make a variable that is assigned a value. While that is functionally accurate, a value is more so an idea of the kind of information a computer can store, pass around, choose, change, remove, etc.
A Computer Program Simply Manages Values
What is a
computer program?A Google search would say,
"a sequence or set of instructions in a programming language for a computer to execute".We can simplify this definition down closer to simply
"telling the computer how to manage values".
Activity - Control a Drawing Robot
This activity introduces the idea that a computer can control a machine by sending values to different parts of the machine.
The student will control a simple drawing robot using only the values 0 and 1.
Prerequisites
- Be able to distinguish the values
0and1. - Be able to follow a sequence of instructions from top to bottom.
Concepts
- Values
- Binary Values
- Input (Reading Values)
- Output (Sending Values)
Coach Strategy
Do not introduce programming syntax during this activity.
The goal is for the student to develop the intuition that different parts of a computer or machine can receive, read, and respond to values.
Avoid explaining how the electronics inside the robot work unless the student specifically asks. It is enough to say that the robot has been built so that its controller responds differently to 0 and 1.
The student should spend most of the activity predicting what the robot will do before being shown the result.
Guide and Solution
The Drawing Robot
Our robot has two wheels and a pen.
Each wheel has its own motor.
The computer controlling the robot can send one value to each motor.
| Value | Motor |
|---|---|
0 | Off |
1 | On |
The robot therefore receives two values:
LEFT MOTOR RIGHT MOTOR
1 1The first value is sent to the left motor.
The second value is sent to the right motor.
When both motors receive 1, both wheels turn and the robot moves forward.
LEFT RIGHT
1 1
│ │
▼ ▼
ON ON
\ /
\ /
ROBOT
│
▼
FORWARDPredict the Robot’s Movement
Give the left motor the value
0and the right motor the value0.Ask the student:
What do you think the robot will do?
Both motors are off, so the robot stops.
Give both motors the value
1.LEFT RIGHT 1 1Both motors turn on, so the robot moves forward.
Give the motors:
LEFT RIGHT 0 1Only the right wheel moves.
The robot turns toward the left.
Reverse the values:
LEFT RIGHT 1 0Only the left wheel moves.
The robot turns toward the right.
Ask the student to complete the following table before revealing the answers.
Left Right Robot Movement 0 0 ? 1 1 ? 0 1 ? 1 0 ?
The completed table is:
| Left | Right | Robot Movement |
|---|---|---|
| 0 | 0 | Stop |
| 1 | 1 | Forward |
| 0 | 1 | Turn Left |
| 1 | 0 | Turn Right |
Two very simple values are already enough to describe several different actions because the values are being sent to different places.
Give the Robot a Pen
Now imagine that the robot has a pen attached underneath it.
The pen controller also receives either 0 or 1.
For this part of the robot:
| Value | Pen |
|---|---|
0 | Pen Up |
1 | Pen Down |
Notice that 1 does not mean motor on everywhere.
For a motor:
1 → Motor OnFor the pen:
1 → Pen DownThe value is read by a particular part of the robot, and that part determines what the value means.
The computer can now send three values at once:
LEFT MOTOR RIGHT MOTOR PEN
1 1 1The robot reads them as:
Left motor on
Right motor on
Pen downThe robot therefore moves forward while drawing.
Make a Drawing
The student will now act as the computer controlling the robot.
For each step, read the three values and determine what the robot does.
| Step | Left Motor | Right Motor | Pen |
|---|---|---|---|
| 1 | 1 | 1 | 1 |
| 2 | 1 | 1 | 1 |
| 3 | 0 | 1 | 1 |
| 4 | 1 | 1 | 1 |
| 5 | 0 | 0 | 0 |
- Read the three values in the first row.
- Determine what each part of the robot does.
- Move an imaginary robot, toy, or marker according to those values.
- Continue to the next row.
- Before each step, predict what will happen.
The sequence can be interpreted as:
Step 1
1 1 1
│ │ │
│ │ └── Pen Down
│ └───── Right Motor On
└──────── Left Motor On
Robot moves forward and draws.Step 2
1 1 1
Robot continues forward and continues drawing.Step 3
0 1 1
The left motor stops.
The right motor continues.
The robot turns left while drawing.Step 4
1 1 1
The robot moves forward again while drawing.Step 5
0 0 0
Both motors stop.
The pen is lifted.What Just Happened?
The computer did not need to directly understand ideas such as:
Move the robot forward.
Turn the robot.
Draw a line.Instead, different parts of the robot were given values.
Computer
│
├── 1 ──> Left Motor
│
├── 1 ──> Right Motor
│
└── 1 ──> Pen ControllerEach part reads the value it receives and responds to it.
By sending different values at different times, the computer can cause the robot to perform a much more complicated action such as making a drawing.
Debrief
- What values did we use to control the robot?
- A.
0and1 - B.
1and2 - C.
ONandOFF - D.
LEFTandRIGHT
Answer
A.
The computer sent the values
0and1.Words such as on, off, left, and right describe how parts of the robot responded to those values.
- What happens when both motors receive
1?
- A. The robot stops.
- B. The robot moves forward.
- C. The pen is lifted.
- D. Nothing can be determined.
Answer
B.
Each motor interprets
1as motor on.Therefore:
LEFT RIGHT 1 1 │ │ ▼ ▼ ON ONBoth wheels move and the robot travels forward.
- What happens when both motors receive
- What happens when both motors receive
0?
- A. The robot moves forward.
- B. The robot turns left.
- C. The robot stops.
- D. The robot draws.
Answer
C.
Both motors interpret
0as motor off, so neither wheel moves.- What happens when both motors receive
- Does the value
1always mean “motor on”?
- A. Yes.
- B. No.
Answer
B.
The meaning depends on which part receives the value.
In this activity:
Motor receives 1 → Motor On Pen receives 1 → Pen DownThe value itself is the same. Different parts of the robot are designed to interpret it differently.
- Does the value
- Consider these values:
LEFT MOTOR RIGHT MOTOR PEN 0 1 1What does the robot do?
- A. Stops and lifts the pen.
- B. Moves forward without drawing.
- C. Turns left while drawing.
- D. Turns right without drawing.
Answer
C.
The left motor is off, the right motor is on, and the pen is down.
Therefore the robot turns left while continuing to draw.
- Which statement best describes what the computer did during this activity?
- A. It physically pushed the robot.
- B. It sent values to different parts of the robot.
- C. It only stored values without using them.
- D. It drew the picture itself.
Answer
B.
The computer sent values to different parts of the robot.
Those parts read the values and responded according to what the values meant to them.
- What is the main idea demonstrated by this activity?
- A. Computers can only work with two values.
- B. A value always means the same thing everywhere.
- C. A computer can manage values by sending them to parts of a system that read and respond to them.
- D. Every computer must control a robot.
Answer
C.
The important idea is not that every computer controls motors.
The activity demonstrates a more general pattern:
value │ ▼ sent somewhere │ ▼ read by something │ ▼ responseComputer programs can store values, read values, change values, create new values, and send values to other parts of a system.