Figure 6: Preparing to teach Tinker about obstacles
First, we have to show Tinker what is special about Block-Z. Every block responds to the function Above, which either returns the block Above it, or NIL if none exists. We type the function Above, then select the line in the Snapshot Window that shows Block-X as the From block. Tinker then displays:
Result: #,(A 'block :name 'Z), Code: (Above From)
This shows Tinker that we chose Block-Z by virtue of its standing in the Above relation to the From block, e.g. Block-X.
Share with your friends: |