Homework Assignment 10
Fun with Strings and Lists
CS 1510
Introduction to Computing
Fall Semester 2014
Due: Friday, November 14, at 10:00 AM
Introduction
Let's use lists to do some more open-ended work. Have as much
fun as you like.
Spec: Word Puzzles
Do Problem 1 on Page 352-353 of your textbook, with a few small
additions:
- For your word list, use
the Unix dictionary
we first saw in Session 19.
- Rather than write a separate program for each puzzle, write
a different puzzle function for each puzzle you solve.
Give each function a suitable name.
- Your program should display a menu of puzzle options, let
the user select a puzzle, and then execute the puzzle.
Repeat this cycle until the user chooses to quit.
- Implement at least five of the puzzles described
in the text. You must do puzzles a, f, and
m. Choose at least two more puzzles that interest
you the most.
- This exercise has a lot of room for variation. For
example, puzzles b and f refer to specific
strings (lmnopqrstuv and memphis,
respectively) that could be replaced with other strings.
You might ask the user for a different string and use
the original if she enters nothing.
Name your program bravo_mr_shortz.py.
If you implement more than five puzzles, give the user the option
to enter different strings, or implement some other extension of
your own device, document the extension in your header
block. I'd love to give out some extra credit this time!
Demonstration of Correctness
Start a fresh Python shell. Run your program in the shell once
for each puzzle that you implement. If a puzzle prints
candidates for the user to select from, such as puzzles a
and d, indicate the answers by hand on your printout.
Save your shell to a text file named
interactions.py.
Deliverables
By the due date and time, submit:
- interactions.py
- bravo_mr_shortz.py
Use
the on-line submission system.
Make sure that your program meets
the course programming standards.
Eugene Wallingford .....
wallingf@cs.uni.edu .....
November 8, 2014