code: func (_ AlgebraicNotation) Encode(pos *Position, m *Move) string {
  	checkChar := getCheckChar(pos, m)
  	if m.HasTag(KingSideCastle) {
  		return "O-O" + checkChar
  	} else if m.HasTag(QueenSideCastle) {
  		return "O-O-O" + checkChar
  	}
  	p := pos.Board().Piece(m.S1())
  	pChar := charFromPieceType(p.Type())
  	s1Str := formS1(pos, m)
  	capChar := ""
  	if m.HasTag(Capture) || m.HasTag(EnPassant) {
  		capChar = "x"
  		if p.Type() == Pawn && s1Str == "" {
  			capChar = m.s1.File().String() + "x"
  		}
  	}
  	promoText := charForPromo(m.promo)
  	return pChar + s1Str + capChar + m.s2.String() + promoText + checkChar
  }
docs: // Encode implements the Encoder interface.