Functional Problem Solving (CSC 151 2014S) : Assignments
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
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 (2010S)] [Rebelsky (2013F)] [Weinman (2012F)] [Weinman (2014S)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)]
Due: 10:30 p.m., Tuesday, 25 February 2014
Summary: In this assignment you will explore the power of conditional processing to make more interesting color transforms and generate a variety of representational images.
Purposes: To give you experience using boolean values, writing predicate procedures, using conditionals, and working with Gimp tools.
Expected Time: Two to three hours.
Collaboration: We encourage you to work in groups of size two or three. You may not work alone. You may discuss this assignment with anyone, provided you credit such discussions when you submit the assignment.
Wrapper (Prologue): Individually read through this assignment and make sure that you understand what is required. Then use the form available at http://bit.ly/151hw5pro to indicate (a) how long you think this assignment will take and (b) what you think will be the most challenging aspect of this assignment.
Wrapper (Epilogue): When you are done with the assignment, fill out the form available at http://bit.ly/151hw5epi to indicate (a) how long the assignment took, (b) what the most challenging part of the assignment was, and (c) something important you learned from doing the assignment. If you find that the assignment took much less or much more time than you expected, also include (d) a note as to what might have led to that difference.
Submitting:
Email your answer to <grader-151-02@cs.grinnell.edu>. The title of your email
should have the form CSC 151.02 Assignment 5: Conditionals and
should contain your answers to all parts of the assignment. Scheme code
should be in the body of the message.
Warning: So that this assignment is a learning experience for everyone, we may spend class time publicly critiquing your work.
Write a suite of three predicates red-dominates?, green-dominates?, blue-dominates? that hold only when the named color channel is greater than both the others.
Note that while you did a similar problem in a previous lab, our definition of dominance here is slightly different. For example,
>(red-dominates? (irgb 128 64 64))#t>(red-dominates? (irgb 64 128 64))#f>(red-dominates? (irgb 64 64 128))#f>(red-dominates? (irgb 128 64 128))#f
Write the color transform irgb-color-enhance
that applies irgb-redder if red dominates the
color, irgb-bluer if blue dominates the color,
irgb-greener if green dominates the color, and
leaves the color unchanged otherwise.
|
flowers |
|
(image-variant flowers irgb-color-enhance) |
|
(image-variant flowers (o irgb-color-enhance irgb-color-enhance)) |
As you have noted, one “fun” aspect of programming the Gimp is that we can make some simple (well, perhaps childlike) representational images, such as the picture we made of a smiley face. Let's explore that aspect in a bit more depth.
Your goal is to document and write a procedure,
( that creates an image of a
scene with something
that might reasonably be interpreted as a modern dwelling
(It might be a house or an apartment building;
it's up to you.) The dwelling must have a door, windows, and a roof.
dwelling width
height)
The two inputs, width and
height, specify the width and height of the
final image. You can assume that the width is never more than twice
the height, and that the height is never more than twice the width
(although you should document both preconditions).
In writing your procedure, you must achieve the following goals.
image-select-ellipse! or
image-draw-line!, etc.)--not drawings--to
make the image.
image-select-polygon!, which has the form (image-select-polygon!
image selection-type
list-of-positions). You can create
each position with (position-new
x y).
ADD, SUBTRACT,
or INTERSECT.
if.
For example, you might decide that if the image is wider than
it is tall, you will have four rows of windows per level and
otherwise have three rows of windows per level.
cond.
For example, you might decide that if the total area of the image is
less than 10,000 square units (e.g., 100x100), you make one-paned windows,
if it's between 10,000 and 40,000 square units (e.g., 200x200), you
make two-paned windows, and if it's bigger than 40,00 square units,
you make four-paned windows.
when.a
For example, you might draw a flower out front only if the image is
exactly square.
If your image consists of several elements, you may wish to collect
each into separate functions to handle each, so that
dwelling remains easy to read and understand.
Finally, please include at least three different calls to your procedure to visualize exemplar images.
(image-show (dwelling __ __)) (image-show (dwelling __ __)) (image-show (dwelling __ __))
Will will primary evaluate your procedures and documentation on their correctness and clarity. For portions of the assignment, we may also assess you on creativity.
Primary: [Front Door] [Schedule] - [Academic Honesty] [Disabilities] [Email] - [FAQ] [Teaching & Learning] [Grading] [Rubric] - [Calendar]
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 (2010S)] [Rebelsky (2013F)] [Weinman (2012F)] [Weinman (2014S)]
Misc: [SamR] [Glimmer Labs] [CS@Grinnell] [Grinnell] [Issue Tracker (Course)]
Samuel A. Rebelsky, rebelsky@grinnell.edu
Copyright (c) 2007-2014 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.