top of page
Screen Shot 2019-01-18 at 11.48.18

How to Code a Sandcastle

Josh Funk

How to Code a Sandcastle

CT Discussion Companion



This is a fictional story about Pearl who has tried many times to build a sandcastle, only to have it destroyed by frisbees, dogs, and sharks! She asks her robot friend Pascal to help her build the sandcastle by giving him instructions in computer code. Working with Pascal, Pearl learns how to decompose problems to make them more understandable, give specific instructions in the right order, and use code she’s written, over and over again.


Amidst the storytelling, it weaves in several very important concepts for computing. First, it talks about how software works and the fact that programmers write the code that tells computers what to do. Second, it introduces the concepts of sequencing and decomposition.


CT Concepts: Sequencing, algorithms, conditionals, loops, decomposition 




Questions to discuss with students after reading this story in order to connect the reading to computational thinking.


  1. What was important for Pearl to do as she gave instructions to her robot friend Pascal? [She needed to break down the steps so the instructions were easier to understand.]

    1. Are there times in your life when you have to plan before you do something? [Going on vacation; getting ready to leave school; having friends over; baking cookies]

    2. Have a student explain how they would create the steps or instructions for one of the activities.

  2. What happened that almost caused a big disaster? [The computer was asked to do too many things without specific instructions.]

    1. What should you do if you make a mistake? [Figure out what went wrong and fix it or try something different.]

  3. Why is it important that Pearl gives Pascal instructions in a certain order? [Robots only know to follow instructions in the order that they are given, they don't know if something is in the wrong order.]



Program your own in-class Robot:

Each student creates instructions on how to do a simple task (create a shape with rubber bands on a geoboard, build something with legos, draw a picture using colored geometric shapes) and gives the instructions to another student, the "Robot", to follow. Students take turns being the "Robot" and follow the instructions. The "Programmer" sees where the Robot is confused and fixes (debugs) their instructions. This process continues until both Robots complete the tasks as the Programmers intended.


Cut the Brownie:

Create a "brownie" using modeling clay in the shape of a square. Using a cutting tool, have students instruct you how to cut the "brownie" into 4 equal parts. Follow their instructions exactly. The first step should be to pick up the cutting tool, but in most cases, the students will just tell you to "cut it into 4 parts". Have the students modify (debug) and add specific steps (decompose) to the instructions until you have 4 equal parts.


Program the Teacher:

A variation of Cut the Brownie is to have your students instruct you how to draw a smiley face on the board. Their instructions should include choosing the marker color, picking up the marker, taking off the cap; how to draw a circle, smile, eyes; taking the marker off the board after drawing each part of the face.



bottom of page