code: func (g *Game) Draw(method Method) error {
  	switch method {
  	case ThreefoldRepetition:
  		if g.numOfRepitions() < 3 {
  			return errors.New("chess: draw by ThreefoldRepetition requires at least three repetitions of the current board state")
  		}
  	case FiftyMoveRule:
  		if g.pos.halfMoveClock < 100 {
  			return fmt.Errorf("chess: draw by FiftyMoveRule requires the half move clock to be at 100 or greater but is %d", g.pos.halfMoveClock)
  		}
  	case DrawOffer:
  	default:
  		return fmt.Errorf("chess: unsupported draw method %s", method.String())
  	}
  	g.outcome = Draw
  	g.method = method
  	return nil
  }
docs: // Draw attempts to draw the game by the given method.  If the
  // method is valid, then the game is updated to a draw by that
  // method.  If the method isn't valid then an error is returned.