Skip to content
This repository was archived by the owner on Jan 25, 2025. It is now read-only.

Chess960 support? #102

@jusahah

Description

@jusahah

First of all, great work with the library!

One issue (or a missing feature) I encountered: it does not handle Chess960 castling correctly.

E.g.

package main

import (
	"fmt"

	"github.com/notnil/chess"
)

func main() {
	fen, _ := chess.FEN("bnqbnrkr/pppppppp/8/8/8/8/PPPPPPPP/BNQBNRKR w KQkq - 0 1")
	game := chess.NewGame(chess.UseNotation(chess.UCINotation{}), fen)

	game.MoveStr("b1a3")
	game.MoveStr("f7f6")
	game.MoveStr("f2f4")
	game.MoveStr("f6f5")
	game.MoveStr("f1f3")
	game.MoveStr("g7g6")
	game.MoveStr("g1g1") // King-side castling

	// print outcome and game PGN
	fmt.Println(game.Position().Board().Draw())
	fmt.Printf("Game completed. %s by %s.\n", game.Outcome(), game.Method())
	fmt.Println(game.String())
}

The PGN does not have the castling move present: 1. b1a3 f7f6 2. f2f4 f6f5 3. f1f3 g7g6 *

Same with the printed board.

Using X-FEN (here bnqbnrkr/pppppppp/8/8/8/8/PPPPPPPP/BNQBNRKR w HFhf - 0 1) to encode the starting position does not help.

Are there any plans to support Chess960?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions