code: function _adjacentPieces(piece, getAdjacent) {
          for (var i=1; i<=6; i++) {
              adjacent = getAdjacent(i);
              if (typeof adjacent === 'undefined') {
                  return false;
              } else if (i === 6) { // can't have more than 6 pieces in a valid line
                  return adjacent;
              }
  
              var samecolor = (adjacent.piece.color === piece.color);
              var sameshape = (adjacent.piece.shape === piece.shape);
  
              // console.log('piece: ' + piece.color + ' ' + piece.shape +
              //             ', adjacent: ' + adjacent.piece.color + ' ' +
              //             adjacent.piece.shape);
  
              // either samecolor or sameshape, not both
              if ((samecolor || sameshape) && !(samecolor && sameshape)) {
                  // add a point for adjacent piece, if not been played this turn
                  if (!game.turn_pieces.some(function(x) {
                      return x.equals(adjacent);})) {
                      points += 1;
                  }
                  continue;
              }
              return adjacent;
          }
          return false;
      }
docs: Helper function, to check whether it is valid to place a piece
  param piece: the piece object being placed
  param getAdjacent: a function that returns an adjacent GamePiece
  return: false if valid placement, otherwise return the offending GamePiece