Skip to content

mururu/gshogi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gshogi

gshogi is a shogi library wrtten in Go.

This is heavily inspired by python-shogi.

Usage

You can build a daemon which can talk USI protocol like the following example.

package main

import (
	"bufio"
	"log"
	"os"

	"github.com/mururu/gshogi"
)

func main() {
	engine := &gshogi.DefaultEngine{}
	handler := gshogi.NewUSIHandler(engine, os.Stdout)
	s := bufio.NewScanner(os.Stdin)

	for s.Scan() {
		t := s.Text()
		if err := handler.Handle(t); err != nil {
			break
		}
	}
	if s.Err() != nil {
		log.Fatal(s.Err())
	}
}

And you can implement a shogi engine. See examples.

Todo

  • Support all USI commands
  • Add helper functions to interact board data easily
  • Add validation and error handling

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages