Up: Blocks World API reference
Package blocks-world
This package contains the source code of chapter 21, "The Blocks World with Classes and Methods" from Lisp (3rd edition)
by Winston and Horn.
About This PackageExample The different kinds of blocks Block properties Concrete block classes The hand A picture of the worldThe block objects represent a world that "looks" like this:/----\ ^ /---------\ ^ | b4 | / \ | | / \ \____/ /_w7_\ | | / \ /----\ /----\ | | / \ /--------\ /^\ | b1 | | b2 | | b3 | / \ | b6 | (l8 ) \____/ \____/ \_________/ /_w5__\ \________/ \./ +-----------------------------------------------------------+ | | +-----------------------------------------------------------+ ExampleIn the initial configuration, where all blocks have been placed directly on the table (not shown), put-on will move the objects like this:BLOCKS-WORLD> (put-on b1 b2) Move hand to pick up B1 at location (1 2). Grasp B1. Removing support relations between B1 and TABLE. Move B1 to top of B2 at location (2 2). Adding support relations between B1 and B2. Ungrasp B1. T The different kinds of blocksMovable blocks than can be moved onto load supporting blocks. Using multiple inheritance, there are also blocks that can do both.The superclass of all objects in the Blocks World (not including the hand). ... The superclass of objects in the Blocks World that other blocks can be placed onto. ... The superclass of objects in the Blocks World that can be moved by the hand. ... Block propertiesSlot readers:Returns the block's name, a symbol. ... Returns the block's position. ... Returns the block's width. ... Returns the block's height. ... Returns the block this instance has been placed onto. ... Returns the blocks that have been placed onto this instance. ... Concrete block classesThese are the blocks found in our world:The table supporting the rest of the world. ... A useful movable building block with a flat top. ... An interesting movable building block. ... The block is a sphere. ... The handThe hand is movable. It can hold at most one block.The hand that moves the world. ... Returns the hand's name, a symbol. ... Returns the hand's position. ... Returns the block the hand is currently holding. ... | Exported Symbol Index
|