Python Project
This is a 2-3 person assignment worth 120
points. Team assignments are here.
60 points for the project. 60 points for the presentation.
Your Python Project Plan is due March 15 by 11:00PM via Sakai (5 pts extra credit).
It should be 1/2-1 page long and include:
- Team member names (2-3 individuals)
- Plan
for a
project: If you are going to do a canned topic from below,
this
can be one line.
If you are making up your own thing, please give me enough detail to understand how feasible it is.
- Outline
of steps to be
completed and target dates:
- descriptions of steps that can be
completed and checked
individually
- dates for the steps to be completed: I will be checking your progess in class. The final project is not an assignment to start the evening it is due!
Project Presentation
Groups will present in class on April 24 or 26. Check here to see when you present.
Grading Rubric
Key items that should be included:
- Total Length: 5 minutes plus 3-4 minutes for questions
- Show your Python code and describe what your functions do
- You won't have time to go through your code line by line
- Focus on the sections of code that perform the key functions of your program
- What data structures (i.e. lists, dictionaries, etc.) did you use?
- How were these data structures used? (i.e. loops, functions, etc.)
- Demonstrate how your program works
- Play the game or show some examples
- Make sure the program runs on the computer you'll be using (I recommend you use one of your own computers for the presentation, bring a VGA adapter if needed)
- Mention if there is anything else your program does that you didn't have time to demonstrate
Project code and additional files due April 26 by 11:00PM via Sakai
The program
should begin with a comment including your names,
a brief description of what the program does and information on any
help you received on
the project. If it
is entirely your own
work, say so. If
anyone helped either of you,
identify them by name and describe how they helped.
Also identify how you helped others.
One partner should submit the file or files for your
project.
If you have multiple project files, combine them into a .zip file.
Note
special
requirements
due to this being a possibly large and open-ended project:
Include a README.txt file that explains how to run your program in
detail, with all the steps to get going, in order. In
particular
with multiple files, what IS the main program? You do not
need to
repeat explicit prompts in your program. In general make sure
you
turn in
every
file you need
to run your program. For instance you have a graphics program
and
use graphics.py, turn in graphics.py. An exception is if you need special packages installed. In such a case be
sure to mention it in the instructions, including how to download and install.
In addition,
everyone should separately
submit a personal file log.txt. Include in the file
- Roughly how long you worked for the project (including
class time)
- Briefly, how it went for you, for instance what was the
hardest part to get working.
- Who your partner(s) was/were.
- Give an indication of how things went
with each partner. Was working together a good
thing? Approximate the percentage of work done by each team member.
This is an open ended assignment. You can do a graphics
program,
a dynamic web program, or some other Python program.
Some
very different (and
increasingly
more difficult) possibilities are mentioned below.
If you
would
like to do something else, read the section on Alternatives at the end
.
Some things are feasible and others are not. You
may not have enough experience to know the difference. Also
it is important to find a way to break the project into a sequence of
steps where you can check yourself before adding too much.
Particularly if you suggest a unique project, discuss this
all with me before you make your written submission of a plan!
Project Ideas
For the following three project ideas, a grade of 50/60 project points will be given for a program that correctly
satisfies the minimum requirements. Better grades will be
given
to projects that implement one or more enhancements and a nice user
interface. I suggest you write a little bit of the program at
a time, and test it after each small feature is added.
Hangman
Code the classic hangman game, where the computer
selects a word randomly from a list, and the player guesses letters,
with a limit for the number of wrong letter guesses, displayed
somehow. Correct guesses need to be indicated
positionally.
For instance for the secret word "program", if the player has correctly
guessed nothing, display underscores for all 7 letters:
_ _ _ _ _ _ _
Later if the user has correctly selected
r,
you should display something like
_ r _ _ r _ _
and then if
g
is selected,
_ r _ g r _ _
.... This display is the trickiest part of a basic version.
The basic version needs neither the web nor graphics, so you can do it
on any kind of computer.
Enhancements
after
you get a
basic text version working:
- display bad past choices or remaining choices
- multiple games with score kept,
- choice of easier and harder versions with words of
different
difficuly levels,
- text graphics or regular graphics just for the image: consider updating the game to Snowman, Skydiver, etc. (Hangman Alternatives)
- (lots of extra credit) a totally graphics based version,
where
the alphabet is shown in
little boxes on the graphics screen and the user just clicks on the
next letter chosen.....
- (also lots of extra credit) fancier version on the web,
possibly
with images. The web
verson could involve typing a letter choice or clicking a radio button
for the right letter....
A Graphics Game: Find the Hole
The program should use Zelle's graphics. Use a random number
generator to select a
point and a perhaps radius around that point. These determine the
target 'hole' and
are not revealed to the player. The user is then
permitted
to click around on the screen to “find the
hole”. You
should show each point the user tries immediately after the
click. Once the user
selects
a point that is within the chosen radius of the mystery point, the
circle should
appear.
There should be a message announcing how many steps it took.
Clicking to find the hole should stop after the hole is
found.
The easiest way to do this is with
while loop
to drive the
repeated search for the hidden circle. The loop should stop
when
the hidden circle is located.
Hint:
If the distance
between
the hidden center and the latest mouse click is less than the radius of
your mystery circle, then the circle is "found". The
bounce2.py
example program has a function getShift to
calculate the difference (dx, dy) in the coordinates of
two points. You can either directly use or modify
getShift
to
calculate the distance from the Pythagorean Theorem: (dx*dx
+
dy*dy)**.5
Here are some enhancements to the hole finding game:
- You can make it more interesting by putting a limit on the
number
of tries the user can have. You could think about what would
be
reasonable – does it depend on the radius? On the number of
possible point? You still
need a while loop, but the condition is more complicated, with two
different reasons to be break out of the loop.
- Add extra graphical items like a display of the count of
the current number of tries.
- You might offer different levels of difficulty for playing
the game – fewer tries, a smaller circle, etc. Do NOT copy
sections of code to make the different levels! Use functions
and
parameters.
- You can always make it more visually appealing.
- You can permit the user to decide the number of games to
play and then display the best score.
- Program reading enhancement: encapsulate logical
unified
ideas in functions with parameter passing, particularly where the same
idea is used in different places with different data.
Automate an analytical pipeline
Using Python modules like pandas,
ggplot, and matplotlib, automate a data analysis pipeline that takes data in a particular format, applies several functions written by you to process, summarize, and plot the data. Output tables and figures of interest. If you are doing research with a professor, this is a great opportunity to apply what you have learned to data of interest to you and your mentor.
Also, feel free to scour the internet for data of interest. Here are some examples:
Be sure to discuss your analysis plan with me before turning in your Project Plan. I am more likely to accept a proposal if multiple functions are planned and your code is generalized to accept any input file with a specified structure. Just a long fixed sequence of steps and hardcoded input is
not
likely to be accepted.
Alternatives ....
Are these too lame or canned or not your style? Suggest
something different to me! You can start by discussing it orally with me, but before final approval, make a written specification for yourself and me, about as specific as what is given for the problems above. The Project Plan is due as stated in the schedule. I am more likely to accept a proposal if it includes a new use of a while-loop or for-loop. Just a a long fixed sequence of steps, even with if statements, is
not
likely to be accepted.