Condensed direction-checking functions, changed 1st player to black.