Skip to content

Chessboard renderer with SDL2 and NCurses on the top of GNUChess UCI Server protocol.

License

Notifications You must be signed in to change notification settings

hpsaturn/chessboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

208 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CMake

GNUChess Frontend

C++ chessboard renderer with SDL2, ASCII, and NCurses on the top of GNUChess UCI server protocol.

Picocalc Preview

Features

  • SDL2 Mode: Graphical chessboard with smooth rendering (default)
  • GNUChess UCI: protocol integration
  • Bitboard validations: improvement using bit arrays of 64 bits
  • Picocalc Luckfox Lyra: Optimized for this mod and board
  • FEN notation support: Basic game state loader via CLI argument
  • Fast game states: Save and load bookmarks with small preview
  • NCurses Mode: Terminal UI with keyboard navigation (in progress)
  • Cross-platform: Works on Linux, Windows, and macOS
  • ASCII Mode: Terminal interface with Unicode pieces (inprogress)

Requirements

Build Dependencies

  • GNUChess
  • CMake (>= 3.10)
  • C++11 compatible compiler
  • SDL2 development libraries (ttf and image dev libraries)
  • Yaml cpp library
  • NCurses development libraries (optional, for interactive terminal mode)

Installation

Linux (Ubuntu/Debian)

# Install development libraries
sudo apt update
sudo apt install gnuchess cmake build-essential libsdl2-dev libsdl2-ttf-dev libsdl2-image-dev libncurses-dev libyaml-cpp-dev

# Build the project
./build.sh

# Test local execution:
./chess

# Install
cd build && sudo make install

Picocalc (Luckfox Lyra Linux)

You need first change your original Picocalc RP2040 board, with a LuckFox Lyra board, put a clean SD and follow the next steps:

git clone --recursive https://github.com/hpsaturn/picocalc-luckfox-lyra.git
cd picocalc-luckfox-lyra
./setup.sh
./build.sh all
./build.sh buildroot-make:gnuchess
./build.sh buildroot-make:chessboard
./flash.sh

For details please visit the follow links:

Easy Linux build for LuckFox Lyra using Docker
Luckfox Lyra on Picocalc

Precompiled binaries (Linux)

I precompiled some versions regulary in releases

Usage

This version is optimized for Picocalc board using Luckfox Lyra. For that it has the next key bindings:

Key Action
Arrows Piece and setting selections
SPACE Select piece or setting
ENTER Move selected piece
ESC Deselect piece or window exit
F1 Show keyboard bindings
F2 Save game state
F3 Load last game state saved
F4 Enter to game states window
BACKSPACE Delete game state (states window)
F5 About and credits
S Enter to settings section
I Toggle to show game info
Q Exit the game. (without state save for now)
R Restart the game. (without ask before for now)
H Help - Keyboard bindings

screenshots

CLI

Also via command line is possible load a FEN state like this:

chess --fen "r3kb1r/ppp1pppp/5n2/8/1q4P1/3b1P2/PP1N3P/R1BQK2R b - - 0 1"

For more about FEN notation and details, please enter here

Ncurses/Chars Board Piece Notation

Piece ASCII NCurses Description
♔ ♚ K k K k King
♕ ♛ Q q Q q Queen
♗ ♝ B b B b Bishop
♘ ♞ N n N n Knight
♖ ♜ R r R r Rook
♙ ♟ P p P p Pawn

Note: Uppercase letters represent black pieces, lowercase represent white pieces.

TODO

  • Framebuffer support for Luckfox Lyra basic Linux buildroot image
  • Adapter class for join with GNU-Chess using UCI protocol
  • Picocalc keyboard issues (fixed)
  • Dead pieces count in each side (Game info window)
  • Basic settings modal window
  • Castelling full validations
  • Ilegal check moves validations (engine crashes)
  • isInCheck() validations
  • Help info modal window
  • Game info modal window (in porgress)
  • Points from the user (positive/negative)
  • Basic Timers
  • Buildroot config files for Luckfox Lyra tests
  • Improve easy mode (seems that is not working)
  • FEN casteling support
  • Flip board
  • Sound support
  • Sprite pieces improvement

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Credits

  • Special thanks to my son, M.V for its continuous critics and beta tests
  • Thanks to @lunokjod for his MongoIA assistant
  • Thanks to Chess SDL project for its CC by SA image assets.

License

This project is GPLv3. Some assets they are licensed under CC BY-SA 3.0. See assets directory for details.

About

Chessboard renderer with SDL2 and NCurses on the top of GNUChess UCI Server protocol.

Topics

Resources

License

Stars

Watchers

Forks

Languages