Extra Credit Assignment:
All aspects of this assignment are
optional.
What Does Extra Credit Mean?
- This is not a normal homework, is not required in any way and
doing this assignment cannot have any negative impact on your grade.
- Doing this assignment could help boost your overall grade. It can
increase your homework average (which represents 25% of your grade).
While all other components of the grade can be at most an A. Due to
this assignment, it is possible to boost your homework grade as high as
A+ (4.3). In short, this could be a way of making up for lower than
expected midterm grades.
Requirements
- Please Submit Only 1 Extra Credit Assignment. Only 1 extra credit assignment will count no matter what.
- There are 2 choices, each involves modifying an existing program that deals with random numbers and sequences.
- Extra Credit A involves extending the random turtle drawing program
- Extra Credit B involves extending the random sentence creation program
- The initial versions of both these programs are online connected with the Collections talk (approximately classes 20-22). They are described in slides 14 to 18.
- You should change the program in noticeable ways.
Grading Criteria
- Is the program clearly written and organized?
- Does it work?
- Is there anything clever, amusing or entertaining?
- After your changes, are the results of the program noticably different than the original program.
Extra Credit Assignment A: The Extended Random Turtle Program
- Modify the Turtle program written in the class.
- Randomly generate similar lists consisting of:
- combinations of 'square', 'triangle', 'circle' and 'left'
- And random numbers from 1 to 10 for physical dimensions and 10
to 90 for angles
- Have the program use 'split' to divide the numbers from the
commands so that the turtles can have more variety in their random
creations
- . Add some fun stuff. These are examples, but do what you want
(don't go too wild):
- Variety of Shapes, Colors, etc.
- Weights, so some actions are more likely than others
- You could record “addresses” in a dictionary (address_book)
indicating where certain shapes are. The x,y coordinates of each turtle
position is returned by turtle.pos(). You could then have a separate
function which causes the turtle to go to the location of a particular
shape by looking it up in the address_book, e.g.,
go_to_shape(blue_triangle) would cause the turtle to go to the last blue
triangle that it drew..
- Incorporate your stick figure functions from the previous
turtle assignment
Extra Credit Assignment B: Extending the Random Sentence Creation Program
Modify the random sentence program to either make it work better or to
tune it to a particular purpose. Several possibilities are given below.
- Fix the grammar in small ways. Examples:
- If 'a' comes before a single noun that begins with a vowel, use 'an' instead.
- Intransitive verbs (laugh, rose, etc.) should occur without a
following noun group. Change the program to allow for this (make a
separate word list)
- Complicate the grammar. For example, add a Prepositional Phrase (or something else):
- Consists of a preposition (of, in, on, about, for, to, …) + a Noun Group
- It can occur: after the noun in a noun group or at the end of a verb group
- Adapt the Program for Some Purpose. Possibilities include:
- Add words associated with a particular domain, e.g., the
subject (first noun group) could optionally be taken from a random list
of names of famous people.
- You can add verbs/adjectives from a particular semantic domain:
biology, sports, food, romance (the current words were chosen based on
frequency)
- Remove words that conflict with your purpose
- Etc.
Please feel free to ask any questions