Version: 4.2.3

Teachpacks

Teaching languages are small subsets of a full programming language. While such restrictions simplify error diagnosis and the construction of tools, they also make it impossible (or at least difficult) to write some interesting programs. To circumvent this restriction, it is possible to import teachpacks into programs written in a teaching language.

In principle, a teachpack is just a library written in the full language, not the teaching subset. Like any other library, it may export values, functions, etc. In contrast to an ordinary library, however, a teachpack must enforce the contracts of the "lowest" teaching language into which it is imported and signal errors in a way with which students are familiar at that level.

This chapter covers the teachpacks for How to Design Programs and How to Design Classes.

    1 HtDP Teachpacks

      1.1 Manipulating Images: "image.ss"

        1.1.1 Images

        1.1.2 Modes and Colors

        1.1.3 Creating Basic Shapes

        1.1.4 Basic Image Properties

        1.1.5 Composing Images

        1.1.6 Manipulating Images

        1.1.7 Miscellaneous Image Manipulation and Creation

      1.2 Simulations and Animations: "world.ss"

        1.2.1 Basics

        1.2.2 Simple Simulations

        1.2.3 Interactions

        1.2.4 Scenes and Images

        1.2.5 A First Example

          1.2.5.1 Understanding a Door

          1.2.5.2 Simulations of the World

          1.2.5.3 Simulating a Door: Data

          1.2.5.4 Simulating a Door: Functions

      1.3 Converting Temperatures: "convert.ss"

      1.4 Guessing Numbers: "guess.ss"

      1.5 MasterMinding: "master.ss"

      1.6 Simple Drawing: "draw.ss"

        1.6.1 Drawing on a Canvas

        1.6.2 Interactions with Canvas

      1.7 Hangman: "hangman.ss"

      1.8 Managing Control Arrows: "arrow.ss"

      1.9 Manipulating Simple HTML Documents: "docs.ss"

      1.10 Working with Files and Directories: "dir.ss"

      1.11 Graphing Functions: "graphing.ss"

      1.12 Simple Graphical User Interfaces: "gui.ss"

      1.13 An Arrow GUI: "arrow-gui.ss"

      1.14 Controlling an Elevator: "elevator.ss"

      1.15 Queens: "show-queen.ss"

      1.16 Matrix Operations: "matrix.ss"

    2 HtDP/2e Teachpacks

      2.1 Batch Input/Output: "batch-io.ss"

      2.2 Images: "image.ss"

        2.2.1 Basic Images

        2.2.2 Overlaying Images

        2.2.3 Rotating, Scaling, and Framing Images

        2.2.4 Image Properties

        2.2.5 Image Predicates

        2.2.6 Equality Testing of Images

      2.3 Worlds and the Universe: "universe.ss"

        2.3.1 Basics

        2.3.2 Simple Simulations

        2.3.3 Interactions

        2.3.4 Scenes and Images

        2.3.5 A First Sample World

          2.3.5.1 Understanding a Door

          2.3.5.2 Hints on Designing Worlds

        2.3.6 The World is not Enough

          2.3.6.1 Messages

          2.3.6.2 Sending Messages

          2.3.6.3 Connecting with the Universe

          2.3.6.4 Receiving Messages

        2.3.7 The Universe Server

          2.3.7.1 Worlds and Messages

          2.3.7.2 Universe Descriptions

          2.3.7.3 Exploring a Universe

        2.3.8 A First Sample Universe

          2.3.8.1 Two Ball Tossing Worlds

          2.3.8.2 Hints on Designing Universes

          2.3.8.3 Designing the Ball Universe

          2.3.8.4 Designing the Ball Server

          2.3.8.5 Designing the Ball World