Version: 4.2.1


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: ""

        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: ""

        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

 Understanding a Door

 Simulations of the World

 Simulating a Door: Data

 Simulating a Door: Functions

      1.3 Converting Temperatures: ""

      1.4 Guessing Numbers: ""

      1.5 MasterMinding: ""

      1.6 Simple Drawing: ""

        1.6.1 Drawing on a Canvas

        1.6.2 Interactions with Canvas

      1.7 Hangman: ""

      1.8 Managing Control Arrows: ""

      1.9 Manipulating Simple HTML Documents: ""

      1.10 Working with Files and Directories: ""

      1.11 Graphing Functions: ""

      1.12 Simple Graphical User Interfaces: ""

      1.13 An Arrow GUI: ""

      1.14 Controlling an Elevator: ""

      1.15 Queens: ""

      1.16 Matrix Operations: ""

    2 HtDC Teachpacks

      2.1 Geometry: geometry.*

      2.2 Colors: colors.*

      2.3 Draw: draw.*

        2.3.1 World

        2.3.2 Canvas

      2.4 Draw: idraw.*

    3 HtDP/2e Teachpacks

      3.1 Batch Input/Output: ""

      3.2 Worlds and the Universe: ""

        3.2.1 Basics

        3.2.2 Simple Simulations

        3.2.3 Interactions

        3.2.4 Scenes and Images

        3.2.5 A First Sample World

 Understanding a Door

 Hints on Designing Worlds

        3.2.6 The World is not Enough


 Sending Messages

 Connecting with the Universe

 Receiving Messages

        3.2.7 The Universe Server

 Worlds and Messages

 Universe Descriptions

 Exploring a Universe

        3.2.8 A First Sample Universe

 Two Ball Tossing Worlds

 Hints on Designing Universes

 Designing the Ball Universe

 Designing the Ball Server

 Designing the Ball World