public int numInDir(int loc, int direction) {
        switch (direction % 4) {
        case 0:
            return numPiecesUpDiag[(loc / 8) - (loc % 8) + 7];
        case 1:
            return numPiecesRow[loc % 8];
        case 2:
            return numPiecesDownDiag[(loc / 8) + (loc % 8)];
        case 3:
            return numPiecesCol[loc / 8];
        default:
            return 0;
        }
    }