CS 221: Completed Assignment 6 #2 (credit https://cs188.googlecode.com/svn/trunk/multiAgents.py)