SkillAgentSearch skills...

AlphaBetaPruning

Alpha-Beat pruning algorithm for Chinese chess

Install / Use

/learn @MegaShow/AlphaBetaPruning
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Alpha-Beta Pruning

Alpha-beta pruning implementation for Chinese chess.

Dependency

  • Golang 1.11+, with Web Assembly for Golang.
  • vschess, Chinese Chess Web UI.

Run with Golang Mux

First, download the sources.

$ go get github.com/MegaShow/AlphaBetaPruning

Then, run and listen at the port 8080.

$ go run main.go -listen :8080

Run with Web Assembly

Suggest that run with Golang Mux for better performance.

First, download the sources.

$ go get github.com/MegaShow/AlphaBetaPruning

Then, build web assembly binary file with Powershell.

$ .\wasm\build.ps1

And you need to modify the source file public/index.html.

chess = new vschess.load(".vschess", {
  clickResponse: vschess.code.clickResponse.red,
  afterClickAnimate: function () {
    getAlphaBetaMoveByWasm(this.getCurrentFen())
    // getAlphaBetaMoveByApi(this.getCurrentFen())
  }
})

Finally, pack the static folder public as website root. Or you can use Golang to open a file server.

$ go run main.go -listen :8080
View on GitHub
GitHub Stars10
CategoryDevelopment
Updated3y ago
Forks1

Languages

Go

Security Score

60/100

Audited on Mar 31, 2023

No findings