Functional Problem Solving (CSC 151 2013F) : EBoards
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning] [Grading]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Setup] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Davis (2013F)] [Rebelsky (2010F)] [Weinman (2012F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)]
Overview
Admin
drawing->image is traditionally used for transforming
one thing to another.image-select-rectangle! is used to
indicate that the procedure changes one or more of its parameters.drawing-rectangle? is used to ask a
true/false question.image-select-rectangle! expects an image.
(The notation is not perfect.)A bit more about documentation
;;; Procedure: ;;; rectangle ;;; Parameters: ;;; left, a real number ;;; top, a real number ;;; width, a positive real number ;;; height, a positive real number ;;; color, a color (whatever that is) ;;; Purpose: ;;; Create a rectangle with the specified characteristics. ;;; OR ;;; Create a rectangle with left edge left, and top edge top, and width width, ;;; and height height, colored color. ;;; Produces: ;;; rect, a drawing ;;; Preconditions: ;;; color is an element of (context-list-colors) ;;; Postconditions: ;;; (drawing-rectangle? rect) is #t ;;; (drawing-width rect) is width ;;; (drawing-height rect) is height ;;; (drawing-top rect) is top ;;; (drawing-left rect) is left ;;; rect is colored color ;;; Problems: ;;; If (left+width < 0) this drawing will not render as given.
Additional
;;; Practica ;;; Props ;;; Philosophy/Ponderings
The produces section should give a name and a type so that we can talk about it.
Postcondition possibliities
;;; [No additional] ;;; vs. ;;; color is an element of (context-list-colors) ;;; vs. ;;; (left + width) > 0 ;;; (top + height) > 0
One set of postconditions (problem: Talk about algorithm, rather than the goal.)
;;; Post-conditions: ;;; drawing-hshift moves the drawing to the left or right depending on the value given ;;; drawing-vshift moves the drawing to the up or down depending on the value given ;;; drawing-hscale stretches the drawing horizontally to provide the drawing with its width ;;; drawing-vscale stretches the drawing vertically to provide the height of the drawing ;;; drwaing-recolor gives the drawing the color based on the choice of color desired in the list of default colors
Questions about the exam
Questions before the quiz
Quiz
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] [FAQ] [IRC] [Teaching & Learning] [Grading]
Current: [Assignment] [EBoard] [Lab] [Outline] [Partners] [Reading]
Sections: [Assignments] [EBoards] [Examples] [Handouts] [Labs] [Outlines] [Partners] [Readings]
Reference: [Setup] - [Functions A-Z] [Functions By Topic] - [Racket] [Scheme Report (R5RS)] [R6RS] [TSPL4]
Related Courses: [Davis (2013F)] [Rebelsky (2010F)] [Weinman (2012F)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)]
Samuel A. Rebelsky, rebelsky@grinnell.edu
Copyright (c) 2007-2013 Janet Davis, Samuel A. Rebelsky, and Jerod Weinman. (Selected materials are copyright by John David Stone or Henry Walker and are used with permission.)

This work is licensed under a Creative Commons Attribution 3.0 Unported License. To view a copy of this
license, visit http://creativecommons.org/licenses/by-nc/3.0/
or send a letter to Creative Commons, 543 Howard Street, 5th Floor,
San Francisco, California, 94105, USA.