Computer Science 110
The Art & Science of Computer Graphics

Mount Holyoke College
Spring 2008


Lecture 12: Programming
Date: Wednesday, March 26, 2008


Agenda

Lecture Assignment

Due at the start of class, Monday, March 31.

Fill in the function definitions below. Please turn in a hard copy (typeset or handwritten are OK). We will discuss these questions during class, so no late submissions are accepted.

  1. A function to return a darker shade of an HSV color.
    (define (darkerHSV c)
    
    
    
    
    )
    
  2. A function that generates a random RGB color.
    (define (randomRGBColor)
    
    
    
    
    )
    
  3. A function that returns one color (provided as a parameter) half of the time (randomly) or a second color (provided as another parameter) the other half of the time.
    (define (pickAColor c1 c2)
    
    
    
    )
    
    So the function call (pickAColor red blue) would randomly return either red or blue.

You may use the helper functions we defined in class examples such as rand, first, etc.

Examples