SAMPLES OF DAVID DURST’S
PROGRAMS
1.
Parametric Equations Volleyball: Created Spring 2010
A.
Download: This download includes the following: (i)
my volleyball program; (ii) user guide, captioned “READEME.txt”; and, (iii)
source code. www.davidbdurst.com/Parametric_Volleyball.zip
B. Language: I wrote this program using Java.
C.
Description: Of the three programs on this website, this one is by far the
most entertaining. I created it because I wanted to develop a physics engine. I
had seen a few engines online and each seemed to store forces in x and y
components. I decided that it would be more interesting to store each force
with a magnitude and direction and then use parametric equations, a concept I
had just learned in math class, to calculate the movement of an object, such as
a volleyball. After creating the engine, I applied it to the development of a
volleyball game. The game is popular with my friends and even a few teachers,
who claimed that they hadn’t previously played videogames.
In
completing this project, I realized the wisdom of the typical method for
creating a physics engine, as opposed to my method. The x and y components used
in calculating the ball’s trajectory in the typical method are easier to use
than the magnitude and direction calculations that I relied upon in designing
my physics engine. While my physics engine is
a bit more complicated than the typical one, I am proud of my ability to develop an alternative design and, on
occasion, ignore common sense.
D.
Running Instructions:
1.
Download and extract the “Parametric Volleyball.zip”
file.
2.
Enter the “Parametric Volleyball” folder.
3.
Double click on the jar file “Parametric Volleyball” (this may also appear as
“Parametric Volleyball.jar”).
E. Miscellaneous: To code this game, I used the external library for tuples that can be found at the following link: http://adventuresinsoftware.com/blog/?p=546
2.
Anthill Simulation: Created Summer - Winter 2009
A.
Download: This download includes the following: (i)
source code; and (ii) the images and text files necessary to run the program. www.davidbdurst.com/Anthill.zip
B. Language: I wrote this program using OCaml.
C.
Description: This program simulates dueling anthills, populated by
red and black ants competing for food. In creating this program, I followed the
guidelines for the 2004 International Conference on Functional Programming
competition (ICFP
Guidelines Link), as
given to me by Professor Steve Zdancewic of the
D. General Information on Running Instructions and Video Links: There are two ways of running this program: with and without graphics. I have successfully run the graphics version only on Linux, and specifically Ubuntu, but I believe that it is possible to run the non-graphics version on other operating systems with the OCaml libraries installed. Below are the instructions for running each of the two versions on Ubuntu 10.10. I realize that the instructions for the graphics version are a bit complicated and I’m happy to provide any additional information or clarifications you may require. Also, to be sure that you will be able to see the graphics version in action, I’m attaching links to a video of the program running with graphics. This link has the video in a WMV format. www.davidbdurst.com/AnthillGUI.wmv This link has the video in an AVI format. www.davidbdurst.com/AnthillGUI.avi These notes will be useful in understanding the content of the video:
1. The file “tiny.world” contains the map of the world that the ants inhabit.
2. The file “sample.ant” contains the instructions that the ants follow as they try to gather food.
3. The numbers represent the amount of food at a particular location on the map.
4. The red rectangles with circular heads are the red ants.
5. The black rectangles with circular heads are the black ants.
6. The red spaces are the red anthills.
7. The black spaces are the black anthills.
8. The gray circles are rocks.
E.
Running Instructions for the Non-Graphics Version:
1. Install “ocamlc” by typing or copying and pasting the following into the terminal and then following the prompts: “sudo apt-get install ocaml-nox” .
2. Download and extract the “Anthill.zip” file.
3.
Open terminal and locate the “Anthill” directory.
4. In the Anthill directory, type “ocamlc -o world world.ml” to build the program.
5. Type “./world” to run the program.
6. In response to the first question prompt, type “tiny.world”; in response to the second type “sample.ant”; and, in response to the third type “sample.ant”.
7. The program will output to a file known as “program_generated_results”, which can be compared with the file “dump all” to ensure that the program ran correctly. This file is merely a concatenation of the ten files posted at the following website: http://alliance.seas.upenn.edu/~plclub/cgi-bin/contest/dump
F.
Running Instructions for the Graphics Version:
1. Install “ocamlc” and the lablgtk2 libraries by typing or copying and pasting the following into the terminal and then following the prompts: “sudo apt-get install ocaml-nox liblablgtk2-ocaml-dev”.
2. Download and extract the “Anthill.zip” file.
3. Open terminal and locate the
“Anthill” directory.
4. In the Anthill directory, type “ocamlc -I +lablgtk2 -o worldGUI lablgtk.cma gtkInit.cmo worldGUI.ml” to build the program.
5. Type “./worldGUI” to run the program.
6. In response to the first question prompt, type “tiny.world”; in response to the second type “sample.ant”; and, in response to the third type “sample.ant”.
7. The program will output to a file known as “program_generated_results_gui”, which can be compared with the file “dump all” to ensure that the program ran correctly. This file is merely a concatenation of the ten files posted at the following website: http://alliance.seas.upenn.edu/~plclub/cgi-bin/contest/dump
3.
Chat Server: Began Winter 2011
A. Download: This download contains the source code: www.davidbdurst.com/chat_server.zip This is a link to the chat website running on my server: http://davidbdurst.com/chat/chat.html
I have not included the SQL database necessary to
run the program on other servers. This database includes email addresses from
friends, along with their encrypted passwords. Accordingly, I cannot disclose
the SQL database necessary to run the program on other servers as doing so
would compromise this information.
B. Language: I wrote this program using
JavaScript, PHP, and SQL.
C.
Description: This program is an instant messaging website that allows
people to chat. I created this website because I wanted to gain more experience
with
D.
Running Instructions:
1. Go to the website http://davidbdurst.com/chat/chat.html
2. Register an account.
3. Login.
4. Commence chatting.
E. Miscellaneous: To code this project, I used the external library for a console that can be found at the following link: http://www.masswerk.at/termlib/ While my website looks similar to the terminal at this link, I wrote all of the backend code, including connections between the database and the terminal. Also, I used the tutorial http://www.w3schools.com/ajax/ajax_xmlhttprequest_create.asp and incorporated some code from it.