Drawing and Motion

From Observation Notes Analysis: U2L1 (now seemingly moved here): "One of the boys at Innovation mentioned that there was an error in Snap’s arithmetic because Snap seems to think that triangles have 360° when we all know that they have only 180°. I didn’t mention exterior angles, but did sketch a map of a road with a second one meeting it at a "sharp" angle. On the map, the angle is small, but what we experience when we bike and turn the sharp angle onto that road is a very large turn. On the polygon, only the interior angle is visible and the program deals only with the exterior angle. We should probably have an image of a map—brief, no fancy language, maybe not even the terminology (because that’ll become a focus and take away from the understanding—in the curriculum with just the kind of informal comment the boy and I discussed. On the map both angles are visible: one is the tiny angle we tend to see; the other is the enormous angle we experience as we move."
Work with a Partner

A script is a sequence of instructions that tells a computer what to do. A program is a set of scripts. In some programming languages, like snap, you program by dragging blocks (individual instructions) and snapping them together. In other languages, you type the instructions. The idea is the same.

For now, you're using blocks that snap provides. Soon, you'll invent and create your own blocks.

  1. Build this script.
    repeat-4(move-50-turn-clockwise-90)
    Clicking anywhere on a script runs it.

    • Click on it to see what it does.
    • Click on pen down and then click on your script again.
  2. Talk with Your Partner Analyze why that script does what it does.
  3. Compare your work with another pair. If your script behaves differently from theirs, check both.
  4. Pair Programming Swap Switch who is sitting at the keyboard.
  5. Experiment! Try these experiments to see what happens.
    1. Change the number in the move 50 steps block in your script and click the script to run it with that new number.
    2. You can click clear (or any block) by itself in its palette or in the scripting area to run it. If you click a block in a script, the entire script runs.
      Click the clear block in the green Pen palette.
    3. Change the number in the turn right 90 degrees block and run the script again... and again... and again.
    4. Change the number in the repeat 4 block.
    5. Experiment with the input numbers in the turn and repeat blocks to get a perfect triangle.
    6. Use set pen size to 1 to set the pen size to something like 4 or 10 or 50. Then draw something.
    7. To change the pen size you must click the set pen size block to run it after you've entered the number you want.
    8. Move the sprite by dragging it to a new location. Does it leave a trace as you move it?
    9. Move the sprite by clicking on move 50 steps. Does it leave a trace as it moves?
    10. Click go to x 0 y 0. (This can get your sprite back when it runs off the screen.) Does it leave a trace?
Pair Programming Swap
 
  1. Experiment more! Invent a design of your own. Below are two other blocks that you may find useful. Find them by color, and click on them to see what they do.

    point in direction 90 set pen color dark red

  2. Draw a circle.   (Don't click unless you really need a hint.)   (Don't click unless you really, really need a super big hint.)
  3. Share Your Work with another pair.
  4. If you see some feature or code that you like, build something like it in your own program.
    Tough Stuff
  5. Challenge: Create a script that draws a blue square of size 100 and then draws a red circle that fits perfectly inside it.
    red circle in blue square
    If you make a design that you'd like to save,
    "U1L2-Drawing"save your work as U1L2-Drawing