CS 1323 Honors, Fall 1996
Individual Project 1
Due Thursday, August 29
Using Canned Software to Arrange Names in Alphabetical Order
- Step 1: Create a file called "names.hs"
with the following contents.
swapNames = unwords . reverse . words
swapAllNamesInSequence names = [swapNames name | name <- names]
(unlines . swapAllNamesInSequence . quicksort .
swapAllNamesInSequence . lines) names
- You must follow the indentation carefully.
- And ... get all the periods and commas in the right places.
- Also ... don't mix up square brackets and round parentheses.
- Step 2: Use the following procedure to
download some canned software from the Web.
- Get into the CS 1323 Honors Class Pages
- Descend through ... Projects, Tips ... Supplied Software ...
to a screen that starts with the line
- Pull down the File menu from the top of the Netscape window
and select "Save As ..."
- Now a dialogue box for saving the file will appear ... Click "OK"
- Congratulations. You now a have file named SequenceUtilities.hs ...
- It contains some library software you will use is in this project.
- Step 3: Get into a terminal window and run your program as follows.
- Enter the command "script" to the Unix system. This will record your session.
- Enter the command "hugs" to the Unix system. This starts the Hugs system.
- When the Hugs system settles down ...
- Enter the command ":load SequenceUtilities.hs" to the Hugs system.
- Enter the command ":also names.hs" to the Hugs system ...
- Now you're ready to run.
- Enter the command "names" to the Hugs system and observe its response.
- Enter the command "namesAlphabetical" to the Hugs system ... Again observe.
- Enter the command ":quit" to the Hugs system ...
- Now you're back out of Hugs and back in Unix.
- Hold the Control-key down and press the D-key.
This stops the script recording.
- Print the file named "typescript" (see your Unix Survival Kit handout) ...
- You now have a printed copy of your session.
- Use the printed copy to prepare your project
to turn in on August 29 at EL114 ...
Follow the Project Style Guide
on the "Project, Tips, etc." web-page.
- Have a bowl of raisin bran with bananas and pecans.