Code from my artificial intelligence class.