Giter Site home page Giter Site logo

cheesse's Introduction

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; 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.

cheesse's People

Contributors

marianogappa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.