$29
CS1372 Homework 8: Linked Lists
Purpose
This assignment is to lear about linked lists.
Instructions
For this assignment, you may use any video mode you deem suitable. However, the graphics must run
smoothly. You should create a ball that moves around the screen. You should also create two spots on the
screen, clearly marked. When a ball passes over the first spot, it should divide into two balls. When a ball
passes over the second spot, it should disappear. Further, pressing the A button should add a ball to the
screen. All your balls should be stored in a linked list. You must have the following:
1. A library for a singly linked list. If you desire, you may include a tail pointer.
2. A function to add an element to the tail of the list
3. A function to remove an element from the list.
4. A linked list containing only the balls on the screen.
Your linked list must use dynamic memory. There should not be a maximum number of elements allowed.
The behaviour of the balls when splitting is up to you. Submit all C files, header files, and your makefile on
T-Square. In addition, be sure that all code files are .c files and not .cpp files. If you use .cpp, the compiler
does not enforce proper C syntax.
As before, include the following in the top of your main file:
///////////////////////////////////////////////////////////////////////
// Name: //
// Prism Account: //
// Collaboration: //
// "I worked on the homework assignment alone, using only //
// course materials." //
// or //
// "I received outside aid on this assigned from the following //
// person(s): //
///////////////////////////////////////////////////////////////////////
1