diff --git a/collects/teachpack/htdp/Docs/world.thtml b/collects/teachpack/htdp/Docs/world.thtml index 5759fd952d..24c198f0d7 100644 --- a/collects/teachpack/htdp/Docs/world.thtml +++ b/collects/teachpack/htdp/Docs/world.thtml @@ -1,10 +1,12 @@ { (define LIBNAME "Animated Images, Simulating Worlds") (include "head.tinc") } -

The teachpack provides two kinds of functions. The first five allow -students to simulate a small world of animated drawings and games: -

-
  • {(idx run-simulation)} : Nat Nat Number [Nat -> Scene] -> true
    +

    The teachpack provides the tools to write simple animations and + interactive games. The first and simplest approach is to set up a + simulation: + +

    +{(idx run-simulation)} : Nat Nat Number [Nat -> Scene] -> true
    (run-simulation width height r create-image) creates and shows a width x height canvas, starts a clock, ticking every r (usually fractional) seconds, @@ -12,14 +14,13 @@ students to simulate a small world of animated drawings and games: the number of ticks passed since this function call.

    In addition, the function pops up a frame and displays the pictures that - create-image generates. The result is a simple animation. -

    + create-image generates. The result is a simple animation.

    Optional: the function consumes an optional fifth argument, a -boolean. If this argument is false or missing, -run-simulation acts as described; if it is present and -true, the function can create an animated GIF of the -simulation after you stop it.

    + boolean. If this argument is false or missing, + run-simulation acts as described; if it is present and + true, the function can create an animated GIF of the + simulation after you stop it.

    Example:

    @@ -33,20 +34,26 @@ simulation after you stop it.

    +
    -

    The teachpack assumes two basic kinds of data: +

    For animated worlds and games, using the teachpack requires that you + provide a data definition for World. In principle, there are + no constraints on this data definition.

    + +

    The teachpack works with two basic forms of data for visualizing the world:

    +Given a data definition for worlds, the following functions create worlds, +visualize it, make the clock tick, and provide feedback about the mouse and +keyboard actions that the program's users perform: + +
    1. {(idx big-bang)} : Nat Nat Number World -> true
      (big-bang width height n w) creates and shows a width x height canvas, @@ -113,10 +120,13 @@ simulation after you stop it.

    2. {(idx end-of-time)} : String u Symbol -> World
      When DrScheme evaluates (end-of-time "the end"), it stops the clock and displays the given string or symbol; no further tick events, key events, or redraw events - take place until the world is created again.
  • + take place until the world is created again. +

    -

    The rest are functions for creating scenes: -

    + +

    For the creation of scenes from the world, use the following functions +plus the functions on images below: +

    1. {(idx nw:rectangle)} : Nat Nat Mode Color -> Image
      (nw:rectangle width height mode color) creates a width x height rectangle, solid or outlined, @@ -143,7 +153,7 @@ simulation after you stop it.

      (run-movie loi) shows the list of images in loi in a time-delayed manner; assume: all images are of the same size -

    +