You think there is life and there are problems. Two separate things. But in reality, they are inseparable. – Buddha
As a parent, you’re told that programming teaches children problem-solving skills, but few educators demonstrate how it does so. Using a childhood game, “rock paper scissors,” we’ll show you how coding naturally develops problem-solving skills in children.
The art of problem-solving
To see how programming teaches problem-solving, we must first understand what problem-solving skills are. We can break problem-solving skills into two connected skills: critical thinking and creativity.
Critical thinking is a kind of analysis that helps us understand the problem by breaking it down into simpler steps. Once we have deconstructed our problem into manageable chunks, we can logically organize the pieces and find a resolution. Through critical thinking, we can evaluate and dissect a problem, but actually solving the problem requires another skill, creativity.
Creativity is crucial because your critical thinking alone can’t give you a solution. Critical thinking can help you assess your ideas, but you have to come up with ideas yourself. Only after coming up with possible solutions can you compare solutions according to their efficiency, your goal, and the resources available.
The creative and critical thinking skills in problem-solving are not distinct. Creativity supplies the content and critical thinking will evaluate this content, neither can solve the problem alone. We learn problem-solving through practice. We have to try, fail, then try again to come up with solutions to problems. Programming is a perfectly safe environment for students to learn problem-solving.
How programming teaches kids the art of problem-solving
The “rock paper scissors” project at CodeWizardsHQ is a perfect example of how students develop problem-solving skills while learning programming. Students will:
1. Break down the game into smaller parts
2. Solve each small part, one by one
3. Repeat until each small part is solved
Kids break down a big problem into small problems
For this project, we initially ask students how they would use code to program the game “rock paper scissors.” The overwhelming reaction is “I don’t even know where to start!”. This is because to begin the program they have to think about the problem critically. Something young students may have never done.
What we’re really asking is, how do you play rock paper scissors? We ask them to deconstruct the game by thinking about it as a series of steps.
As soon as we teach them how to think about the problem, they can usually use that thought process to formulate these three steps:
Students solve problems using direct application of what’s taught in class
After the student has deconstructed this problem, they realize how breaking down a problem puts them in a much better position to solve it. Confusion turns to confidence as they have now figured out a starting point.
We then prompt them to take each of the steps or mini-problems and solve them one at a time. For the first step, the computer needs to ask the user to make a choice. Students will know how to solve this specific problem because one of the first things they learn in class is how to make the computer ask for input from the user.
For the second step in the game, the computer needs to choose from the same options presented to the user: rock, paper, or scissors. This step requires the student to think of a way for the computer to make a choice.
The student might think to themselves, “when I play rock paper scissors what the other person chooses is random to me.” Luckily, they already know how to write code that tells the computer to create a random number. It’s a common programming problem that has a standard solution. All they need to do now is connect the random number to the computer’s choice.
Students solve problems by applying what’s taught in a different context
In our example, we’re using Python. In order to get a random choice, the computer must first generate a random number between 1 and 3. Students then program “if” statements that attach each potential number to one of the choices – rock, paper, or scissors. The computer now randomly picks from rock, paper, or scissors by generating a random number.
Students solve problems using logical thinking
For the last step, they need the computer to decide who the winner is based on the choices made by the user and the computer. The computer will show a different output for each combination but, since students rarely practice organizing their thoughts, all of these combinations might feel jumbled in their heads. To solve this problem, we ask them to list each of the combinations and outcomes by organizing them in a logical drawing. With a little guidance, they end up with a decision tree like this.
For every user choice, the computer can randomly pick from three options. By extending that logic the student can organize three possible user choices with three corresponding computer choices each, a total of nine outcomes.
When we get students to tell us about how the computer reaches each outcome, they start to explain it in an “if-then” structure. “If I pick rock, and the computer picks scissors, then the computer outputs ‘rock wins’.” Transferring this logical “if-then” structure into code for each of the nine outcomes is just a matter of knowing the correct syntax.
The result in Python:
Our “rock paper scissors” game shows how students can go from not knowing where to start to completely solving a difficult problem using code. Programming forces students to exercise their critical thinking and problem-solving skills. It’s an exciting and fun way for students to learn and build on these skills.
The practice of breaking down problems, logically structuring solutions, and picking the best solution applies to more than coding. They are actively used in school and work. Students can build on what they learn while programming and applying these skills to the problems they face in everyday life.