LEARNING TO THINK PROGRAMMATICALLY AS AN EVERYDAY SKILL

Learning to code may not be for everyone, but as technology continues to reach deeper into our lives, an ability to understand and participate in it has become increasingly important.

But more than that, programmatic thinking offers tools for strategizing, problem-solving and creativity that can be useful in everyday life.

This is why DUAL was created.

WHAT DO PLAYERS LEARN?

Many computer programs are built with three common patterns: selection, sequence and loop. Playing DUAL introduces all of these concepts.

SELECTION

When you use conditions you're testing to see if shapes on the grid return TRUE or FALSE. If a shape matches the condition, it will return TRUE. If it doesn't match, it returns FALSE. In code these are called conditional statements.

You can see how these work in the game below.

IF SHAPE ROW IS EQUAL TO 0 THEN RETURN TRUE

During each step of the sequence, the program loops through the shapes on the grid and checks which return TRUE. Shapes that pass these 'tests' are grouped and targeted by whichever action the player chose. Shapes that return false are faded out. See below for more about sequences and loops.

With AND between two conditions, the program returns TRUE if both conditions are met. With OR the program returns TRUE if either condition is met. Consider what this would mean if you combined two of the above conditional statements.

SEQUENCE

A program reads code in sequential order, responding to changing states as it goes along. This is exactly how sequences work in the game!

SHAPES EQUAL TO ROTATE TO

SHAPES EQUAL TO SWITCH TO

SHAPES EQUAL TO SWITCH TO

The program reads the code from top to bottom. After the first condition is tested and the first action is taken, the program moves to the next step. At this point the next condition is tested, but the shapes on the grid have now changed. Being able to anticipate such changes and plan ahead is key to playing the game – and key to being good at programming.

LOOPS

When you hit play, the program loops through every shape on the grid: first to check if each shape meets your set of conditions and then to perform each action in your sequence.

Let's see what the loop returns for the conditions below.

↓TRUE

Loops are used all the time in programming to go systematically through a set of items or objects. Sometimes this is to find things, or test conditions like above. Sometimes it's to collect or change things. Computers are great at repetitive tasks that people would find boring.

WHAT NEXT?

DUAL wasn't designed to teach players how to code, but to get them started thinking programmatically. Many programmers would agree that writing code isn't actually the hard part – figuring out the logic for a program is. If the concepts in DUAL make sense to you then you've already taken a huge leap!

Thinking programmatically is really about thinking in terms of systems. The world is full of systems – making programmatic thinking an invaluable skill.

The web is brimming with great resources for learning programming. Here are some next steps: