Tiles Teachpack
(require tiles/tiles) |
1 About This Teachpack
Provides a variety of functions for combining and manipulating images. Imagine that each image were on a ceramic tile; you would expect to be able to put two tiles together side by side, or one above another, or rotate a tile, etc. That’s exactly what this teachpack provides.
2 Installation
start DrScheme
switch languages to Module and click "Run"
- in the Interactions pane, type
after a few seconds, you should see the message "Wrote file "tiles.ss" to installed-teachpacks directory."
switch languages back to one of the HtDP languages, like Beginning Student
from the Language menu, choose "Add Teachpack..." and select "tiles.ss"
click "Run"
3 Functions
(reflect-vert img) → image? |
img : image? |
Flips an image top-to-botom.
(crop-top img pixels) → image? |
img : image? |
pixels : natural-number/c |
(crop-bottom img pixels) → image? |
img : image? |
pixels : natural-number/c |
(crop-left img pixels) → image? |
img : image? |
pixels : natural-number/c |
(crop-right img pixels) → image? |
img : image? |
pixels : natural-number/c |
4 Functions from image.ss
Since anybody using these functions will almost certainly also want to use other image-creation and image-manipulation functions, this teachpack includes the standard teachpack image.ss. That is, if you have tiles.ss loaded, you don’t also need image.ss (and you’re better off not loading it).