Skip to content

Package, server, cli tool and WebAssembly binary for chess use cases.

License

Notifications You must be signed in to change notification settings

marianogappa/cheesse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cheesse

Simple package, server, CLI tool and WebAssembly binary for all things chess.

Please note that this library is NOT YET ready for mainstream use. Its API is not final, two of its API methods are not fully implemented, and it hasn't yet been battle-tested against a massive corpus of games (only about 300).

API

DefaultGame() OutputGame
ParseGame(game InputGame) (OutputGame, error)
DoAction(game InputGame, action InputAction) (OutputGame, OutputAction, error)

// Currently only supporting Algebraic Notation & ICCF; others coming soon
ParseNotation(game InputGame, notationString string) (OutputGame, []OutputGameStep, error)

// Coming soon
ConvertNotation(game InputGame, notationString string, toNotation string) (OutputGame, []OutputGameStep, error)

Server example

$ ./cheesse -serve 8080
$ curl localhost:8080/defaultGame | jq .game.board.board
[
  "♜♞♝♛♚♝♞♜",
  "♟♟♟♟♟♟♟♟",
  "        ",
  "        ",
  "        ",
  "        ",
  "♙♙♙♙♙♙♙♙",
  "♖♘♗♕♔♗♘♖"
]

CLI example

$ ./cheesse -defaultGame | jq .game.board.board
[
  "♜♞♝♛♚♝♞♜",
  "♟♟♟♟♟♟♟♟",
  "        ",
  "        ",
  "        ",
  "        ",
  "♙♙♙♙♙♙♙♙",
  "♖♘♗♕♔♗♘♖"
]

Package import example

package main

import (
  "fmt"

  "github.com/marianogappa/cheesse/api"
)

func main() {
	for _, s := range a.DefaultGame().Board.Board {
		fmt.Println(s)
	}
}
♜♞♝♛♚♝♞♜
♟♟♟♟♟♟♟♟
        
        
        
        
♙♙♙♙♙♙♙♙
♖♘♗♕♔♗♘♖

WebAssembly example (using TinyGo compiler)

Auto-play

Why is it called "cheesse"?

That's roughly how kiwi people pronounce chess.

About

Package, server, cli tool and WebAssembly binary for chess use cases.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages