fenimore / ghess

Chess engine, AI, cli interface, and websocket client ♞
https://ghess-chess.herokuapp.com/
GNU General Public License v3.0
13 stars 0 forks source link
chess-engine fen minimax pgn

GitHub issues GoDoc Go Report Card CircleCI

go-chess || ghess

A Golang chess engine and user interfaces. Challenge the AI, Ghess, online.

|Move:  3     Turn: b
|Check: false Castle: KQkq
|Mate:  false Score: *
8: |♖||♘||♗||♕||♔|| ||♘||♖|
7: |♙||♙||♙||♙|| ||♙||♙||♙|
6: |░|| ||░|| ||░|| ||░|| |
5: | ||░||♗||░||♙||░|| ||░|
4: |░|| ||░||♟||♟|| ||░|| |
3: | ||░|| ||░|| ||♞|| ||░|
2: |♟||♟||♟|| ||░||♟||♟||♟|
1: |♜||♞||♝||♛||♚||♝|| ||♜|
   :a::b::c::d::e::f::g::h:
Black to move:

Instructions

ghess.go is a Go package responsible for representing a chess board, parsing PGN input, and validating moves. In the UI branch, in the ui/ directory, clichess.go is a simple interface for debugging and growser.go is a browser client powered by websockets. See godoc for the docs.

Basic Features and Functionality

Search and Evaluate Features


Bitmap

The chess engine works with a 120 (10x12) bitmap []byte slice, stored in the Board board field. This boils down to (accessible with the /coordinates command in clichess.go):

Coordinates:
8: |88||87||86||85||84||83||82||81|
7: |78||77||76||75||74||73||72||71|
6: |68||67||66||65||64||63||62||61|
5: |58||57||56||55||54||53||52||51|
4: |48||47||46||45||44||43||42||41|
3: |38||37||36||35||34||33||32||31|
2: |28||27||26||25||24||23||22||21|
1: |18||17||16||15||14||13||12||11|
   :a ::b ::c ::d ::e ::f ::g ::h :

Road Map:

  1. FIXME: SearchForValid empassant
  2. FIXME: Horizon Effect
    • Keep track of capture state to combat horizon effect
  3. FIXME: Invalid fen when first Move number is not zero
  4. TODO: Change Board to Game
  5. TODO: Save history

Basic Functionality


User Interfaces

Clichess

clichess

Growser

License

Copyright (C) 2016 Fenimore Love

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.