Code that I wrote in my AI class (CS 4100).