Problem Set 1
Home Up Problem Set 1 Problem Set 2 Problem Set 3 Problem Set 4 Problem Set 5 Problem Set 6 Problem Set 7 Problem Set 8 Problem Set 9 Problem Set 10 Final Project

 

Due 5PM Friday, September 10.

Chapter 1:

Do exercise1.2 in SOE.
Do exercise1.3 in SOE.

Chapter 2:

Do exercise2.2 in SOE.

Chapter 3:

In Hugs, load the file SimpleGraphics, which is the code from Chapter 3, by
doing the following from the command line:

Hugs>:l SimpleGraphics

Browse the source code with your favorite editor, and try running some of the graphics examples, such as names that begin with "main". Also type :? at the command line, to see the various commands that Hugs supports, and try them out. Remember that one letter can be used as an abbreviation for any command (e.g., ":l" for ":load", ":t" for ":type", etc.).

Do exercise 3.1 in SOE.

Chapter 4:

Load the module Draw into Hugs, which contains the source code from Chapter 4.
Browse the source code, and run some of the examples.

Use your solution to Exercise 2.2. to do the following: Define a function "conPoly" whose type is Int -> IO (), so that "conPoly n" draws n concentric regular polygons, with a triangle in the middle, and successively larger regular polygons surrounding it.  Use your aesthetic prowess to make it look good -- e.g. using colors and arrange sizes of successive polygons so that they enclose one another.

 

Solutions.