A chess engine written in golang

Weasel

Logo Art graciously provided by Alex

Table of Contents:

About

Weasel is an 0x88 and bitboard based chess engine written entirely in Go. It utilizes alpha-beta pruining with null searhes to find the best possible moves in the shortest amount of time while utilizing the UCI (Universal Chess Interface) protocol. Weasel is programmed with all possible chess moves such as castling and En passant, as well as full knowlege on topics such as the 50 move rule and stalemates. Upon testing against other engines, we believe that Weasel is the strongest chess engine written in Go.

You can play Weasel here. But if you want the full strength of weasel we recommend downloading it.

Downloading, or Compiling from Source

You can find the most recent stable release here.

To compile from source, please do the following:

After you have Go and a GUI you can install Weasel simply with

go get github.com/WeaselChess/Weasel

And from within the Go src folder simply run the following to compile

go generate
go build

Contributing

If you wish to contribute to our project, please contact us via Email. You may also submit a Pull Request to be reviewed.

License

This project is currently licensed under GPLv3. This means that you may use our source for your own project, so long as it remains open source and is licensed under GPLv3.

Please refer to the license file for more information.

Owner
Comments
  • Make engine

    Make engine

    https://github.com/WeaselChess/Weasel/blob/f64208de9f6770d601c2670ebb0d7d117af674e5/main.go#L4-L5


    This issue was generated by todo based on a TODO comment in f64208de9f6770d601c2670ebb0d7d117af674e5. It's been assigned to @Trey2k because they committed the code.
  • illegal move made

    illegal move made

    2021-02-13 20:39:53.285-->1:position startpos moves d2d4 g8f6 c2c4 e7e6 g1f3 d7d5 e2e3 f8e7 b1c3 e8g8 d1c2 c7c5 c4d5 c5d4 e3d4 e6d5 f1e2 b8c6 e1g1 f8e8 c1e3 c8g4 f1e1 a8c8 f3e5 g4e2 e1e2 f6e4 e5c6 c8c6 c2b3 e4c3 b2c3 c6b6 b3a4 b6a6 a4b3 a6b6
    2021-02-13 20:39:53.285-->1:go wtime 11061 btime 18674 winc 1000 binc 1000
    2021-02-13 20:39:53.287<--1:11061
    2021-02-13 20:39:53.289<--1:time: 368 start: 1613266793285 stop: 1613266794653 depth 64 timeset true
    2021-02-13 20:39:53.291<--1:info score cp -5 depth 1 nodes 106 time 1 pv b3c2
    2021-02-13 20:39:53.293<--1:info score cp -5 depth 2 nodes 431 time 1 pv b3a4 b6a6
    2021-02-13 20:39:53.295<--1:info score cp -2 depth 3 nodes 1037 time 1 pv b3a4 b6a6 a4b3
    2021-02-13 20:39:53.297<--1:info score cp -2 depth 4 nodes 2749 time 2 pv b3a4 b6a6 a4b3
    2021-02-13 20:39:53.300<--1:info score cp -2 depth 5 nodes 6732 time 4 pv b3a4 b6a6 a4b3
    2021-02-13 20:39:53.303<--1:info score cp -2 depth 6 nodes 16004 time 8 pv b3a4 b6a6 a4b3
    2021-02-13 20:39:53.332<--1:info score cp -2 depth 7 nodes 103393 time 45 pv b3a4 b6a6 a4b3
    2021-02-13 20:39:53.400<--1:info score cp -2 depth 8 nodes 276512 time 113 pv b3a4 b6a6 a4b3
    2021-02-13 20:39:54.041<--1:info score cp -2 depth 9 nodes 1815930 time 754 pv b3a4 b6a6
    2021-02-13 20:39:54.655<--1:bestmove b3a4
    2021-02-13 20:39:54.655*1*Found move:Qb3-a4
    2021-02-13 20:39:54.815*2*Child Process Prio Adj:  PID 25200 conhost.exe
    2021-02-13 20:39:54.816*2*Start calc, move no: 39
    2021-02-13 20:39:54.871-->2:time 1868
    2021-02-13 20:39:54.871-->2:otim 1070
    2021-02-13 20:39:54.871-->2:b3a4
    2021-02-13 20:39:54.873<--2:1 0 0 95 d8b8
    2021-02-13 20:39:54.875<--2:2 0 0 414 b6a6
    2021-02-13 20:39:54.877<--2:3 0 0 2650 b6a6
    2021-02-13 20:39:54.888<--2:4 0 1 19263 b6a6
    2021-02-13 20:39:54.979<--2:5 0 10 146344 b6a6
    2021-02-13 20:39:55.495<--2:move b6a6
    2021-02-13 20:39:55.495*2*Found move:Rb6-a6
    2021-02-13 20:39:55.634*1*Child Process Prio Adj:  PID 25544 conhost.exe
    2021-02-13 20:39:55.636*1*Start calc, move no: 40
    2021-02-13 20:39:55.637-->1:position startpos moves d2d4 g8f6 c2c4 e7e6 g1f3 d7d5 e2e3 f8e7 b1c3 e8g8 d1c2 c7c5 c4d5 c5d4 e3d4 e6d5 f1e2 b8c6 e1g1 f8e8 c1e3 c8g4 f1e1 a8c8 f3e5 g4e2 e1e2 f6e4 e5c6 c8c6 c2b3 e4c3 b2c3 c6b6 b3a4 b6a6 a4b3 a6b6 b3a4 b6a6
    2021-02-13 20:39:55.637-->1:go wtime 10691 btime 19070 winc 1000 binc 1000
    2021-02-13 20:39:55.639<--1:10691
    2021-02-13 20:39:55.641<--1:time: 356 start: 1613266795638 stop: 1613266796994 depth 64 timeset true
    2021-02-13 20:39:55.643<--1:info score cp -2 depth 1 nodes 78 time 0 pv a4b3
    2021-02-13 20:39:55.645<--1:info score cp -2 depth 2 nodes 315 time 0 pv a4b3 d8d7
    2021-02-13 20:39:55.647<--1:info score cp 0 depth 3 nodes 700 time 0 pv a4b3
    2021-02-13 20:39:55.650<--1:info score cp -2 depth 4 nodes 2604 time 1 pv a4b3 d8d7 a1e1 a6e6
    2021-02-13 20:39:55.653<--1:info score cp 0 depth 5 nodes 9211 time 4 pv a4b3
    2021-02-13 20:39:55.686<--1:info score cp 0 depth 6 nodes 118856 time 46 pv a4b5 a6b6
    2021-02-13 20:39:55.757<--1:info score cp 0 depth 7 nodes 277140 time 118 pv a4b5 a6b6
    2021-02-13 20:39:55.931<--1:info score cp 0 depth 8 nodes 660084 time 292 pv a4b5 a6b6
    2021-02-13 20:39:56.573<--1:info score cp 0 depth 9 nodes 2107523 time 934 pv a4b5 a6b6
    2021-02-13 20:39:56.996<--1:bestmove a4b5
    2021-02-13 20:39:56.996*1*Found move:Qa4-b5
    2021-02-13 20:39:57.153*2*Child Process Prio Adj:  PID 25200 conhost.exe
    2021-02-13 20:39:57.154*2*Start calc, move no: 41
    2021-02-13 20:39:57.215-->2:time 1907
    2021-02-13 20:39:57.215-->2:otim 1034
    2021-02-13 20:39:57.215-->2:a4b5
    2021-02-13 20:39:57.217<--2:1 0 0 316 a6b6
    2021-02-13 20:39:57.220<--2:2 0 0 730 a6b6 b5a5
    2021-02-13 20:39:57.222<--2:3 0 0 4111 a6b6 b5a5 b6b1
    2021-02-13 20:39:57.236<--2:4 0 2 25607 a6b6 b5a4
    2021-02-13 20:39:57.331<--2:5 0 11 156173 a6b6 b5a4
    2021-02-13 20:39:57.852<--2:move a6b6
    2021-02-13 20:39:57.852*2*Found move:Ra6-b6
    2021-02-13 20:39:58.005*1*Child Process Prio Adj:  PID 25544 conhost.exe
    2021-02-13 20:39:58.006*1*Start calc, move no: 42
    2021-02-13 20:39:58.007-->1:position startpos moves d2d4 g8f6 c2c4 e7e6 g1f3 d7d5 e2e3 f8e7 b1c3 e8g8 d1c2 c7c5 c4d5 c5d4 e3d4 e6d5 f1e2 b8c6 e1g1 f8e8 c1e3 c8g4 f1e1 a8c8 f3e5 g4e2 e1e2 f6e4 e5c6 c8c6 c2b3 e4c3 b2c3 c6b6 b3a4 b6a6 a4b3 a6b6 b3a4 b6a6 a4b5 a6b6
    2021-02-13 20:39:58.007-->1:go wtime 10336 btime 19450 winc 1000 binc 1000
    2021-02-13 20:39:58.009<--1:10336
    2021-02-13 20:39:58.011<--1:time: 344 start: 1613266798007 stop: 1613266799351 depth 64 timeset true
    2021-02-13 20:39:58.013<--1:info score cp 0 depth 1 nodes 85 time 0 pv
    2021-02-13 20:39:58.015<--1:info score cp 0 depth 2 nodes 292 time 0 pv
    2021-02-13 20:39:58.018<--1:info score cp 0 depth 3 nodes 436 time 0 pv
    2021-02-13 20:39:58.021<--1:info score cp 0 depth 4 nodes 1193 time 1 pv
    2021-02-13 20:39:58.024<--1:info score cp 0 depth 5 nodes 7837 time 4 pv
    2021-02-13 20:39:58.027<--1:info score cp 0 depth 6 nodes 18278 time 7 pv
    2021-02-13 20:39:58.030<--1:info score cp 0 depth 7 nodes 46426 time 21 pv
    2021-02-13 20:39:58.059<--1:info score cp 0 depth 8 nodes 132697 time 51 pv
    2021-02-13 20:39:58.854<--1:info score cp 0 depth 9 nodes 2026609 time 846 pv
    2021-02-13 20:39:59.354<--1:bestmove a4b5
    2021-02-13 20:39:59.354*1*---------> Arena:Illegal move!: "a4b5" (Feinprüfung)
    2021-02-13 20:39:59.361****Tour**Game end: 0-1 {0-1 Arena Adjudication. Illegal move!}
    2021-02-13 20:39:59.361****Tour**Last game won by Tscp181 with Black in 21 moves
    2021-02-13 20:39:59.362****Tour**Weasel  -  Tscp181: 
    2021-02-13 20:39:59.362****Tour**  19 B 2    2.0:1.0        16.0:3.0      8:39:59 PM     0.00    21 7.909 :5.000  15-2-2
    2021-02-13 20:39:59.426****Tour**Saving file C:\Chess\Arena\Tournaments\Weasel Test 8.at.pgn Round:19 2021.02.13 20:39:28
    2021-02-13 20:39:59.503****Tour**stopping engine calculation after game...
    2021-02-13 20:39:59.504-->2:?
    2021-02-13 20:39:59.504<--2:Error (unknown command): ?
    2021-02-13 20:39:59.527-->2:result 0-1
    2021-02-13 20:39:59.527<--2:Error (unknown command): result
    2021-02-13 20:40:00.673****Tour**
    2021-02-13 20:40:00.673****Tour**Pairing 1/7: Weasel  -  Horizon_4_4
    
  • 3 fold repbug

    3 fold repbug

    position startpos moves g1f3 c7c5 c2c4 g8f6 b1c3 e7e6 g2g3 b7b6 f1g2 c8b7 e1g1 f8e7 f1e1 f6e4 d2d4 e4c3 b2c3 e8g8 e2e4 d7d6 c1f4 d8c7 g2f1 b8c6 f1d3 e6e5 d4e5 d6e5 f4e3 a8d8 d1e2 d8d6 a1d1 f8d8 d1d2 e7f6 e1d1 d8d7 g3g4 f6e7 g4g5 c7d8 e2f1 a7a6 f1e2 b7a8 g1f1 d6e6 f1g1 a8b7 g1h1 d8c7 h1g1 c7c8 h2h4 e6d6 h4h5 f7f6 f3h4 f6g5 h4f5 d6f6 f5e7 c6e7 e3g5 f6d6 f2f4 e7c6 e2h2 h7h6 g5h4 e5f4 h2f4 g7g5 h5g6 d6g6 g1h1 d7f7 f4h2 c8g4 d1g1 g4g1 h2g1 g6g1 h1g1 c6e5 d3e2 b7e4 d2d6 f7g7 g1f1 g7g6 d6g6 e4g6 h4d8 g8f7 d8b6 e5d7 b6c7 h6h5 f1g2 d7f6 c7g3 f7e6 g2f3 g6b1 a2a3 b1f5 f3f4 f5g4 e2d3 f6d7 g3f2 e6d6 f2e3 a6a5 e3f2 d7b6 f2g3 d6e6 f4g5 e6d7 g3f2 d7d6 f2g3 d6c6 d3e4 c6d7 g3f2 d7d6 f2g3 d6e7 g3f2 e7d6

    This position is reported as 3 fold rep when it should not be. Been struggling with 3 fold bugs all day.

  • Check if out of time

    Check if out of time

    https://github.com/WeaselChess/Weasel/blob/e5810ceae8f20ac4a661c0fc8a4a7b6cdee35809/engine/search/search.go#L189-L194


    This issue was generated by todo based on a TODO comment in e5810ceae8f20ac4a661c0fc8a4a7b6cdee35809. It's been assigned to @Trey2k because they committed the code.
  • Add option to set hash size in mb

    Add option to set hash size in mb

    https://github.com/WeaselChess/Weasel/blob/021a16132c2b18e924e58e830dcf6dd507a63646/engine/uci/uci.go#L54-L57


    This issue was generated by todo based on a TODO comment in 021a16132c2b18e924e58e830dcf6dd507a63646. It's been assigned to @Trey2k because they committed the code.
  • Redo with global piece constants

    Redo with global piece constants

    https://github.com/WeaselChess/Weasel/blob/1aa879c7e5db866df662bce069df8e6506bc178d/engine/io.go#L52-L57


    This issue was generated by todo based on a TODO comment in 1aa879c7e5db866df662bce069df8e6506bc178d. It's been assigned to @ChristianHering because they committed the code.
  • Add supprot for fifty move rule and current ply

    Add supprot for fifty move rule and current ply

    https://github.com/WeaselChess/Weasel/blob/76fad07e8818a2631dc17625f3925f4c04e0140c/engine/board.go#L277-L282


    This issue was generated by todo based on a TODO comment in 76fad07e8818a2631dc17625f3925f4c04e0140c. It's been assigned to @Trey2k because they committed the code.
  • Create Decimal to algebraic notation function

    Create Decimal to algebraic notation function

    https://github.com/WeaselChess/Weasel/blob/3966150c38f6dc321f91972a87c27e5ba5972651/engine/board.go#L311-L315


    This issue was generated by todo based on a TODO comment in 3966150c38f6dc321f91972a87c27e5ba5972651. It's been assigned to @Trey2k because they committed the code.
  • Switching should only happen on first word

    Switching should only happen on first word

    In UCI switching should only be done on the first word of the command because any number of arguments can follow.

    https://github.com/WeaselChess/Weasel/blob/f413417d98a317768096f453cbd2b92c338ef4c3/uci/uci.go#L24

  • Add supported options

    Add supported options

    https://github.com/WeaselChess/Weasel/blob/1c74e6d2f966625b3538cd703832557b9dbde911/uci/uci.go#L56-L59


    This issue was generated by todo based on a TODO comment in 1c74e6d2f966625b3538cd703832557b9dbde911. It's been assigned to @ChristianHering because they committed the code.
A chess engine written in golang
A chess engine written in golang

Weasel Art graciously provided by Alex Table of Contents: About Installing and Compiling from Source Contributing License About Weasel is an 0x88 and

Dec 30, 2022
Currently in beta testing. A chess engine written in golang
Currently in beta testing. A chess engine written in golang

Weasel Art graciously provided by Alex Table of Contents: About Installing and Compiling from Source Contributing License About Weasel is an 0x88 and

Dec 30, 2022
A cli to play chess against an an UCI engine of your choice, written in go
A cli to play chess against an an UCI engine of your choice, written in go

chess-cli chess-cli is a cli for playing chess against an UCI compatible engine written in go Note: Chess pieces are in unicode, so the color may seem

Mar 1, 2022
A cli to play chess against an an UCI engine of your choice, written in go
A cli to play chess against an an UCI engine of your choice, written in go

chess-cli chess-cli is a cli for playing chess against an UCI compatible engine written in go Note: Chess pieces are in unicode, so the color may seem

Dec 24, 2021
A simple chess engine for experiment, made in Golang

chess-engine A simple chess engine for experiment, made in Golang Build the engine Run the command make or make build Run the engine Run the command f

Dec 26, 2021
Blunder is an open-source UCI compatible chess engine.

A UCI compatible chess engine written in Golang

Dec 30, 2022
Play chess with Go, HTML5, WebSockets and random strangers!

ChessBuddy Play chess with Go, HTML5, WebSockets and random strangers! Demo: http://chess.tux21b.org:8000/ Hint: Open the page in two different tabs,

Nov 10, 2022
♛♔ Play chess against UCI engines in your terminal.
♛♔ Play chess against UCI engines in your terminal.

uchess ♛♔ Play chess in your terminal. Introduction uchess is an interactive terminal chess client designed to allow gameplay and move analysis in con

Nov 17, 2022
chess package for go
chess package for go

chess Introduction chess is a set of go packages which provide common chess utilities such as move generation, turn management, checkmate detection, P

Dec 26, 2022
A chess GUI build using the Fyne toolkit.
A chess GUI build using the Fyne toolkit.

Chess The subject of my current live stream series. A simple chess UI built with Fyne. Thanks to: Chess Go library by Logan Spears github.com/notnil/c

Dec 20, 2022
Play chess in your terminal
Play chess in your terminal

Gambit Chess board in your terminal. Warning gambit does not have many features at the moment. I plan on adding a chess engine, mouse support, timers,

Dec 21, 2022
A small go program that solves the Queen's Gambit chess puzzle.

Queen's Gambit Solver This program attempts to solve the Queen's Gambit each time it is run. The Queen's Gambit is a chess-based puzzle where eight qu

Jun 27, 2022
chess.com api wrapper for go

Chessdotcom-go An unofficial, simple, lighweight API wrapper for chess.com written in go Usage go get -u "github.com/ATTron/chessdotcom-go" im

Dec 31, 2021
A chess server built with Temporal.
A chess server built with Temporal.

chesstempo A chess server built with Temporal. Dependencies The activity worker runs Stockfish in the background. In Debian-based distros, you can ins

Nov 21, 2022
Engo is an open-source 2D game engine written in Go.

Engo A cross-platform game engine written in Go following an interpretation of the Entity Component System paradigm. Engo is currently compilable for

Dec 26, 2022
Scalable Distributed Game Server Engine with Hot Swapping in Golang
Scalable Distributed Game Server Engine with Hot Swapping in Golang

GoWorld Scalable Distributed Game Server Engine with Hot Reload in Golang Features Architecture Introduction Get GoWorld Manage GoWorld Servers Demos

Dec 25, 2022
A small fantasy game engine in WASM using GoLang
A small fantasy game engine in WASM using GoLang

The GoLang Fantasy Engine (GoLF Engine) is a retro game engine. It draws inspiration from fantasy console projects like pico-8, tic-80, and pyxle. Like those projects it is designed to be a retro-feeling game creation/playing tool. Unlike those projects GoLF is more minimal in scope and only provides an API and a small set of tools to help you create your games. Tools like an image editor and code editor are not built in. Despite this minimalism creating games in GoLF is still easy and should still maintain the retro game feel.

Jul 16, 2022
golang powered game engine
golang powered game engine

Gobatch Go powered engine that offers features from low level opengl abstraction to UI framework. I created this to separate lot of logic from game am

Nov 13, 2022
Go 3D Game Engine
Go 3D Game Engine

G3N - Go 3D Game Engine G3N (pronounced "gen") is an OpenGL 3D Game Engine written in Go. It can be used to write cross-platform Go applications that

Jan 9, 2023