Skip to content
Physics and Astronomy
Home Our Teaching Resources C programming project-options.html
Back to top

PHY2027 project options

Science-based

  1. Planetary motion. This will require, or develop, a degree of confidence with using multiple strutures using either a linked list or array of structures. (NB: you must model the equations of motion not just assume a particular solution such as an ellipse.)
    1. Have a collection of structures each representing a "planet" (one or more of which could be stars). Two-dimensions is easiest.
    2. Translate into the rest frame (ie. sum of momentum equals zero)
    3. Repeatedly:
      • Calculate the force on each object
      • Move each object.
    4. Advanced option:
      • Fire a rocket from one planet to another
  2. Conway's game of life.
  3. Predator/prey relationships.
    • Ideally have several species with a structure representing each and what it eats. That is: have one structure definition and allocate a structure for each type of animal, do not have a different type of structure for each animal.
  4. Numerical integration: program several algorithms and compare the error with the exact answer.
    • Advanced option: try integrating over more than one dimension.

Games

  1. Reversi/Othello
  2. Mine sweeper.
  3. Mastermind (see the Mastermind description).
  4. Black-jack

Be careful of spending too much time on pretty text-based diagrams or printing large amounts of text. Be sure to make use of structures and to avoid misuse of copy and paste.

Other than Reversi/Othelo games are normally the easier option in themselves (science-related ones are better) but you can add difficulty by:

  • Saving high scores.
  • Allowing players to save a game part-way through and restart it the next time the program is played.
  • Having multiple players and organising a contest.
  • Having the program play you.
                                                                                                                                                                                                                                                                       

Validate   Link-check © Copyright & disclaimer Privacy & cookies Share
Back to top