Fixed bug with diagonalMoves and straightMoves

Changed some cases where it would continue counting after seeing an
occupied square. Also changed where it would incorrectly add one to the
variable even thought it would be out of bounds.