go-chess-models, v1.2-alpha
Posted on

The library that implements checking and generating of chess moves.
Implementing real types of pieces, but without individual checkings of moves.
Change Log
- implementing real types of pieces, but without individual checkings of moves.
Examples
pieces.Knight.ApplyPosition():
package main
import (
"fmt"
models "github.com/thewizardplusplus/go-chess-models"
"github.com/thewizardplusplus/go-chess-models/pieces"
)
func main() {
piece := pieces.NewKnight(models.Black, models.Position{File: 2, Rank: 2})
fmt.Printf("%+v\n", piece)
updatedPiece := piece.ApplyPosition(models.Position{File: 4, Rank: 3})
fmt.Printf("%+v\n", updatedPiece)
// Output:
// {Base:{kind:4 color:0 position:{File:2 Rank:2}}}
// {Base:{kind:4 color:0 position:{File:4 Rank:3}}}
}
Repository
Link: https://github.com/thewizardplusplus/go-chess-models/tree/v1.2-alpha.
Content: code.
License: MIT.