Tinker: a programming by Demonstration System for Beginning Programmers by Henry Lieberman Media Laboratory Massachusetts Institute of Technology

Figure 9: Distinguishing between two cases

Download 177.19 Kb.
Size177.19 Kb.
1   ...   7   8   9   10   11   12   13   14   15
Figure 9: Distinguishing between two cases

The predicate expression calls the function Cleartop? which asks a block if its Above block is NIL. Cleartop? is true when applied to Block-A and false when asked of Block-X.

Tinker creates a recursive definition, incorporating a conditional expression, as shown in the window containing the Lisp definition at the upper right of the next figure.

Figure 10: Recursively removing obstacles

To test it, we give it a configuration of blocks containing several obstacles on the From block, and Stack is called recursively several times in order to get rid of all the obstacles, before performing the Move-Block operation.

Figure 11: An example showing an obstacle on the To block [Block 2]

Similarly, we can show Tinker another example, building a stack of Block 1 and Block 2, below, that demonstrates how to clear obstacles on the To block instead of on the From block.

Figure 12: Tinker can then perform this example, where obstacles appear on both From and To blocks

Then, Tinker will be capable of doing by itself a more ambitious example, a stack with Block D and Block E, that contains obstacles on both the From and To blocks.

Share with your friends:
1   ...   7   8   9   10   11   12   13   14   15

The database is protected by copyright ©essaydocs.org 2020
send message

    Main page