Jump into drawing with bootstrap code by Pamela Ossorio |
Design Recipe1 |
|||
Description |
Draw a rectangle of a given width and height in pixels |
||
Contract/Purpose statement |
|||
Function name |
Domain |
Range |
|
rectangle |
number number string string |
image |
|
Examples |
|||
Example 1 |
(rectangle 400 400 "solid" "White") |
||
Example 2 |
(rectangle 100 250 "outline" "blue") |
||
Definition |
rectangle (width height style color) |
Design Recipe 2 |
||||
Description |
Draw a canvas |
|||
Contract/Purpose statement |
||||
Function name |
Domain |
Range |
||
blank |
rectangle |
image |
||
Examples |
||||
Example 1 |
(define blank (rectangle 100 100 "solid" "white")) |
|||
Example 2 |
(define blank (rectangle 100 100 "solid" "white")) |
|||
Definition |
(define fcn-name (rectangle width height style color)) |
|||
Actual wescheme coding syntax:(define blank (rectangle 400 400 "solid" "white")) |
Design Recipe 3 |
||||
Description |
Place rectangle at a specific location on canvas |
|||
Contract/Purpose statement |
||||
Function name |
Domain |
Range |
||
put-image |
rectangle |
image |
||
Examples |
||||
Example 1 |
(put-image (rectangle) 200 360) |
|||
Example 2 |
(put-image (rectangle) 150 350) |
|||
Definition |
(put-image (rectangle width height style color) x y) |
|||
Actual wescheme coding syntax:(define Mond-example
add ")" for each additional put-image command added |
Recommended tutorial: http://www.bootstrapworld.org/materials/fall2015/HourOfCode/ |
||
IDE |
![]() |
Curriculum Resources |