CSCI 1300 - Programming Homework 4
Birds in Flight
Due Thursday, Mar 22 at 11:55pm


Homework Policy [CAUTION!]

For programming assignments, you may consult with others (instructors, other students, etc.). You may look at and discuss algorithms or programs that are under development provided that you do not make a copy of any code in any way (no file copying, no xerox copies, no copying by hand, etc.), nor may you allow another student to make a copy of your code. You may also use any references (books, web, etc.) provided that include a comment that cites any resources used (not needed for our textbook)

As a student, you are responsible for knowing and adhering to this policy. Violations will be reported to the CU Honor Code Council and result in an F for the entire course.


Birds in Flight

Please note that this assignment indicates precisely what your program should accomplish, without a precise indication of how the program works. Part of your assignment is designing the techniques of how the program works.

What the Program Should Do

This project involves a simulation of the paths taken by animals interacting with other animals or with inanimate objects. The program should be written so that can be easily adapted to change the rules governing the movement of the animals.

As an example consider the interaction from which the project gets its name: birds in flight. The program could start with several birds, each represented by a pixel or image on the screen. Initially each of these birds moves in a randomly chosen direction. One bird is the leader and is under the control of the program's user, using the mouse in some way. All of the other birds on the screen tend to gradually change their paths so that they follow some other bird in a way that eventually leads to the leader.

As another example consider the path taken by a moth attracted to a light. Some investigators have proposed that a moth navigates by maintaining a constant heading to a light source. If you use this proposal as a rule governing the moth's movement, what kind of path results?

As still another example consider the path taken by a predator to capture its prey. The prey moves at random. What kind of simple rule will lead to capture? Hint: Have the predator move faster than the prey. As a variation on this theme you may want to place obstacles between the predator and the prey, and have another rule for determining the predator's move when an obstacle is encountered..

Other Program Requirements