Home Assignments Lecture Blog Resources Discussion Group

N-Body Simulation

We'll be working through the Princeton assignment at

More details will be provided as their material assumes Java and we're using C++.

Here are the particular assignment requirements for us:

  • You should build a command-line app which accepts the same parameters as the one specified, and reads the universe file from stdin. E.g., if your app is named NBody, you would run it with:
NBody 157788000.0 25000.0 < planets.txt
  • Please submit all files needed to build your project—.cpp, any header files, and a Makefile if you have one. If you are on Ubuntu and you didn't use a Makefile, include in your main file instructions on how to compile and link.
  • Include the binary executable. If possible, set to link with static libraries so that the binary can be run on other machines.
  • Include a desktop recording of your app running. You could upload to YouTube and include a link to that.
  • Fill out and include this readme.txt file with your work.