Functional Problem Solving (CSC 151 2014F) : EBoards

CSC151.01 2014F, Class 11: A Design Perspective


Overview

Preliminaries

Admin

Upcoming Work

Campus Events of Interest

Extra Credit Opportunities

Academic

Peer Support

Discussion of Quiz 2

Sketch or describe the final image that results from evaluating the following series of Scheme expressions. Your answer should clearly indicate the color, size, and position of each shape.

    (define d1 (scale-drawing 20 drawing-unit-circle))
    (define d2 (hshift-drawing 30 d1))
    (recolor-drawing "red" d1)
    (recolor-drawing "blue " d2)
    (image-show (drawing->image (drawing-group d1 d2) 50 50))

At times, it is useful to find the center of a drawing. The center of a square, rectangle, circle, or ellipsoid is a point whose x coordinate is midway between the left edge and the right edge, and whose y coordinate is halfway between the top edge and bottom edge. There are many possible definitions of the center of a compound drawing; but the "halfway" rule works as a starting approach. Write a procedure, (drawing-center-x drawing), that returns the x coordinate of the center of a drawing, using the halfway rule. For example,

    > (drawing-type my-cool-drawing)
    'group
    > (drawing-left my-cool-drawing)
    10
    > (drawing-width my-cool-drawing)
    40
    > (drawing-center-x my-cool-drawing)
    30 ; The left edge is 10, the right is 50 (10 + 40)
    > (drawing-left small-square)
    0
    > (drawing-width small-square)
    1
    > (drawing-center-x (drawing-group my-cool-drawing small-square))
    25 ; The left edge is 0, the right edge is fifty

Finish the definition below

    (define drawing-center-x

Discussion of Homework 3

I was talking to a student about combinatorics and noted that CS and math share a characteristic that for some problems, you need a moment of insight. We know that you are just developing skills as problem solvers, and try to lead you to that insight. We also try to help you develop general processes.

With that said, let's consider two key ideas that might help you solve the neighbor problems.

We'll start with a circle of radius 40, centered at 120,80.

Discussion of Testing

Colors (and design)!

A bit about design

A bit about color theory