Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this Page (locked)Uploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Homework 6- Spring 2008

Homework 6- Spring 2008
Due: Monday, April 21st, 11:55 PM

In this homework, you will use your knowledge of turtles, general programming, and creativity, to finish off the semester with some dazzle. We are giving you a lot of choices and freedom of interpretation for this assignment. Have fun.

Turtle Dancing with the Stars

Your assignment is to program some turtle choreography. The turtles should "dance" (that is move in a coordinated way, relative to each other) to an accompaniment of music or appropriate sounds. You have a choice of choreographic approaches.

EITHER

(1) Program 5-10 turtles to dance to a short (at least 15 second) musical accompaniment. Examples: Waltz, line dance, hokey pokey, etc. The music should be somewhat appropriate.

OR

(2) Program 2-3 turtle planets to orbit a turtle star. At least one of the planets should have moons. These particular heavenly bodies will look like turtles, rather than spheres, but that's OK. (According to the Babylonians, the universe rested on the back of a giant turtle, so whatever.) You can either play some space music along with the simulation or generate your own music of the spheres according to how the planets line up. Be creative.

OR

(3) Program football-playing team turtles to execute a play. For example, you will have a quarterback turtle, turtle receivers, etc. You may even have a football turtle that the quarterback "throws". Play some appropriate NFL music, crowd noises, or college marching band music.

OR

(4) Simulate a party. The turtles congregate in small groups talking and occasionally drift off to join other groups. Please don't make the party too wild. Make them middle aged turtles, to be on the safe side. The turtles could be saying "rhubarb, rhubarb", or there could be music in the background.

OR

(5) Turtles red in tooth and claw. Program a pack of killer turtles cooperating to corner a hapless herbivore victim. Give the victim a chance to escape. See if you can find appropriate animal noises.

OR

(6) Have a squad of soldier turtles march in formation across the screen to appropriate music. Make sure that they start, stop, turn, etc., in time.

OR

(7) Make up your own choreography example. You will need an appropriate number of turtles for the problem (certainly no fewer than three, and maybe as many as 20), a policy or algorithm for each about where they move relative to each other, and an appropriate musical accompaniment.


Details, details

(1) The musical accompaniment must be played by the program as a Python sound. (So, it has to be a .WAV or maybe .AIFF format file.)

(2) Your code should start with a standard collaboration statement as a Python comment.

(3) Immediately after the collaboration statement, you should include a short description of your program. Say what the turtles represent, what their choreography represents, and how the music is relevant and synchronized. Make sure to include all three parts as it makes up a good portion of your grade.

Example: "This program shows two planets, one of them with a moon, orbiting a star. One of the planet orbits in retrograde motion. Because of a peculiarity of turtle celestial mechanics, the planets orbits are octagons, rather than ellipses. One of the planets has a moon. The innermost planet has a year half the length of the outer planet. The synthesizer music plays for an entire year of the outermost planet, and restarts every time the planet passes its starting point."

Example: "This program shows eight dancers viewed from above performing choreographed dancing modeled after the classic Busby Berkeley dance sequences from 1930s Hollywood movies to big-band dance music. The dancers move in and out together and then rotate in two circles (well, 42-gons) in time to the music.

(4) Your main function should be called choreography() and should take no arguments.

(5) Your function should access only pictures and sounds in the mediapath directory.

(6) To submit your work, submit it as usual on T-square with at least two attachments: (a) the code itself in a .py file (NOT the .pylog log file!), and (b) at least one sound file with a .wav or .aif/.aiff extension. If you use any pictures for the background, make sure that you submit those as well.


Suggestions

(1) DO NOT copy large segments of code that has been uploaded to the CoWeb, especially if you do not fully understand the code. While such code may be useful for understanding, none of the examples are close enough to this open-ended assignment to be a good starting point.

(2) You MAY but DO NOT HAVE TO use object-oriented features such as classes, subclasses, and overridden methods. Only define new constructors if you are feeling very ambitious. It's probably not necessary. Depending on the problem you choose and the behaviors that you want to program, you may be able to program your solution completely just using turtle functions. If you want to change turtle colors, you will need to invoke the methods setBodyColor() and setShellColor() (and maybe the setColor() method of getPen()), but you will not need to subclass turtles. The posted chameleon example from Spring 2007 shows how to change a turtle's color. Unfortunately, it is not easy to change its appearance.

(3) If you want to change the world's background, use the following trick:
(a) Create a picture at least as large as the world
(b) Move a turtle to x=0, y=0 in the world
(c) Have the turtle drop the the picture
(You can create a tiled world by dropping smaller pictures at the location corresponding to the top-left corner of each tile.)

(4) Two resources you may find useful for sound files are http://www.findsounds.com/ and http://www.soundswap.org. You have to register at the latter site if you want to download sounds. You may use copyright sounds for educational use, but please do not distribute your sounds outside the class if your sounds are copyright.

(5) To synchronize sounds and actions, work out how long the sound is by counting its samples and finding its sampling rate. You can then use time.sleep() with a corresponding delay to synchronize with the sound.


How Your TA will Grade

(1) Copy the program and sound file or files to a single directory and setMediaPath() to that directory.
(2) Run program.
(3) Read your explanation, and observe the running program with audible accompaniment.
(a) Does the program meet the requirements above?
(b) Do the explanation and program behavior agree?
(c) Does the program run to completion without problems?
(d) Craft. Are the turtles choreographed appropriately & synchronized with sound?
(e) Creativity and imagination. You will not receive full points for creativity if your code produces the same result as someone else's. This should not discourage collaboration, but it is not very creative to create the same thing.

Extra credit: 10 points: If you create something that is extraordinarily creative or go above and beyond the basic requirements. You must exceed at least 2 requirements (for example: don't just play a sound, record your own sound and then play it or change the size of the turtle, but still keep the synchronization) in order to receive these points and mention that you completed the extra credit in your collaboration statement. In addition, you must add another section to your program description that explains why your program exceeds the requirements and what requirements you went above and beyond. As usual, extra credit is all or nothing if you have questions about whether or not something will count as extra credit, you can e-mail me (bduncan [at] gatech [dot] edu) but realize that the extra credit is just trying to get you to go above and beyond what we expect.

Questions?