From 012895cbfe1b1f30e7d0cea6c0947571cdc8735c Mon Sep 17 00:00:00 2001
From: Matthias Felleisen
Date: Thu, 18 Oct 2007 14:36:24 +0000
Subject: [PATCH] rewrote world.ss; it had gotten out of sync with code
svn: r7523
---
collects/teachpack/htdp/Docs/world.thtml | 54 ++++++++++++++----------
1 file changed, 32 insertions(+), 22 deletions(-)
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:
-
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:
-World
, which is something you must define;
-
Image
, which are either inserted into DrScheme via the
- "Special" menu or constructed from the functions below; and
-
-Scene
, which are created from Image
s. Indeed,
- they are just special images.
-
+ "Special" menu or constructed from the functions below; and
+Scene
, which are created from Image
s.
+ Specifically, a scene is an image whose pinhole is at position (0,0).
+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:
+
+
{(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.
{(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:
-
+