Skip to content

PedanticHacker/StrikeChess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ StrikeChess 1.0

Python 3.14+ License: MIT Stockfish 17.1

πŸ“– What's this?

StrikeChess is a feature-rich chess application for playing against engines and analyzing positions. With a sleek, customizable interface, comprehensive time controls, and powerful analysis tools, StrikeChess provides everything you need for studying and playing chess.


πŸ“‘ Table of Contents


πŸš€ Quick Start

Prerequisites

  • Python 3.14 or newer

Installation

pip install -r requirements.txt
python main.py

🍎 macOS users: Use pip3 and python3 instead

πŸ“– Detailed installation instructions | πŸ“¦ Creating a standalone executable


✨ Features

β™ŸοΈ Core Gameplay

Interface - Intuitive drag-and-drop with smooth animations, legal move indicators, coordinate labels Game Modes - Human vs Engine, Human vs Human, play as either color Board Controls - Flip board (Ctrl+F), automatic orientation, last move arrows, check highlighting

πŸ€– Engine Features

Default Engine - Stockfish 17.1 included for all platforms Custom Engines - Load any UCI-compatible engine Strength Control - Adjustable via ponder mode, automatic move timing based on clock Force Move - Make the engine play immediately

πŸ”¬ Analysis Tools

Real-time Analysis - Position evaluation with animated bar (F3/F4) Visual Indicators - Best move arrows, evaluation display, mate distance Opening Recognition - Extensive opening database with name display Position Setup - FEN editor with paste and validation support

⏱️ Time Controls

Seven preset time controls with four increment options each:

Time Control Increment Options
1 minute 0, 6, 12, or 30 seconds
3 minutes 0, 6, 12, or 30 seconds
5 minutes 0, 6, 12, or 30 seconds
10 minutes 0, 6, 12, or 30 seconds
20 minutes 0, 6, 12, or 30 seconds
30 minutes 0, 6, 12, or 30 seconds
1 hour 0, 6, 12, or 30 seconds
2 hours 0, 6, 12, or 30 seconds

Features - Digital countdown clocks, automatic increment, flag detection

πŸ’Ύ Game Management

Move History - Complete move table with navigation Game Review - Jump to any position, scroll through moves PGN Support - Save and load games with proper headers and metadata Position Editor - Set up custom positions via FEN

🎨 Themes

Choose from 8 carefully designed themes (4 dark, 4 light):

Dark Themes

Theme Shortcut Description
Dark Forest Alt+1 Deep greens with natural tones
Dark Mint Alt+2 Cool teals and aqua shades
Dark Nebula Alt+3 Purple and violet cosmic colors
Dark Ocean Alt+4 Navy blues with ocean depths

Light Themes

Theme Shortcut Description
Light Forest Alt+5 Soft greens and earth tones
Light Mint Alt+6 Fresh teals and aqua highlights
Light Nebula Alt+7 Bright purples and lavender
Light Ocean Alt+8 Sky blues and ocean surface

All themes provide coordinated color schemes across UI elements, custom board colors, matching evaluation bars, and readable text in all conditions.

πŸ”Š Sound Effects

Distinct audio feedback for different moves:

Move Type Sound
Standard moves Basic piece movement
Captures Distinctive capture sound
Castling Special castling sound
Check Alert when king is in check
Pawn promotion Promotion sound effect
Game over End-of-game sound

πŸŽ“ How to Play

β™ŸοΈ Making Moves

Drag and Drop

  1. Click and hold a piece
  2. Dots appear on legal squares
  3. Drag to a legal square
  4. Release to play your move

πŸ‘‘ Pawn Promotion

When promoting a pawn:

  1. Play the promotion move
  2. A dialog appears with piece options
  3. Click your desired piece (β™• Queen, β™– Rook, β™— Bishop, or β™˜ Knight)
  4. The promotion completes

πŸ”¬ Engine Analysis

To analyze a position:

  1. Click Start Analysis (or press F3)
  2. The evaluation bar animates to show position assessment
  3. The best move appears as an arrow on the board
  4. The variation panel shows the principal line
  5. Click Stop Analysis (or press F4) to end

πŸ“Š Understanding the Evaluation

Display Meaning
+2.50 White is ahead by 2.5 pawns
-1.75 Black is ahead by 1.75 pawns
M5 White has checkmate in 5 moves
M-5 Black has checkmate in 5 moves

πŸ“– Reviewing Games

Navigate through your game history:

  • ⬅️ Left Arrow / Mouse Wheel Up -> Previous move
  • ➑️ Right Arrow / Mouse Wheel Down -> Next move
  • πŸ–±οΈ Click -> Jump to move

πŸ”¨ Setting Up Positions

  1. Copy a FEN string
  2. Double-click the FEN editor (below the board) to paste from clipboard
  3. Valid positions load automatically
  4. Invalid FEN strings show a red warning
  5. Edit any FEN string to set custom positions

βš™οΈ Settings

Access settings via Ctrl+, or the toolbar button.

Player Configuration

Human Name Set your player name (appears in saved PGN files)

Engine Color

  • Black - You play White, engine plays Black
  • White - You play Black, engine plays White

Performance Tuning

Ponder Mode Enable to let the engine think during your turn (stronger play, uses more CPU)

Time Control Select base time and increment for both players

πŸ’Ύ Note: Settings are preserved between sessions in ~/.StrikeChess/settings.json


⌨️ Keyboard Shortcuts

General

Shortcut Action
Ctrl+N New game
Ctrl+Q Quit application
Ctrl+, Open settings
F1 About dialog

Files

Shortcut Action
Ctrl+O Load game from PGN
Ctrl+S Save game as PGN

Engine

Shortcut Action
Ctrl+L Load engine
Ctrl+U Unload engine
Ctrl+P Force engine to play move now

Analysis

Shortcut Action
F3 Start position analysis
F4 Stop position analysis

Board

Shortcut Action
Ctrl+F Flip board
← / β†’ Navigate move history
Mouse Wheel Scroll through moves

Themes

Shortcut Theme
Alt+1 Dark Forest
Alt+2 Dark Mint
Alt+3 Dark Nebula
Alt+4 Dark Ocean
Alt+5 Light Forest
Alt+6 Light Mint
Alt+7 Light Nebula
Alt+8 Light Ocean

πŸ“„ PGN Files

πŸ’Ύ Saving Games

  1. Click Save as PGN (Ctrl+S)
  2. Choose location and filename
  3. Game is saved with complete headers and metadata

Example PGN Output:

[Event "StrikeChess Game"]
[Site "Computer"]
[Date "2025.11.16"]
[Round "1"]
[White "Player"]
[Black "Stockfish 17.1"]
[Result "1-0"]

1. e4 e5 2. Nf3 Nc6 3. Bb5 a6 4. Ba4 Nf6 5. O-O Be7 1-0

πŸ“‚ Loading Games

  1. Click Load from PGN (Ctrl+O)
  2. Select a valid PGN file
  3. Game loads with all moves
  4. Navigate through the game freely
  5. Continue playing from any position

πŸ“Έ Screenshots

Settings
πŸ”§ Configuring time controls and engine settings


Table view
πŸ“œ Reviewing game history with the move table


Engine analysis
πŸ”¬ Analyzing a position with evaluation bar and variation display


Pawn promotion
πŸ‘‘ Selecting a promotion piece


πŸ†˜ Troubleshooting

Engine Won't Load

Problem: "Cannot load UCI engine" error appears

Solutions:

  • βœ… Verify the file is a UCI-compatible chess engine
  • βœ… Ensure the engine matches your platform (Windows/Linux/macOS)
  • βœ… Check CPU architecture compatibility (x86_64, ARM, etc.)
  • βœ… On macOS: The app automatically removes quarantine attributes
  • βœ… On Linux: The app automatically sets executable permissions

macOS Quarantine Issues

If macOS blocks the engine:

  1. The app attempts to remove quarantine attributes automatically
  2. If issues persist, manually run:
xattr -d com.apple.quarantine /path/to/engine

PGN Won't Load

Problem: "Cannot load game" error

Solutions:

  • βœ… Verify the file contains valid PGN format
  • βœ… Check for missing or malformed headers
  • βœ… Ensure move notation is correct
  • βœ… Try opening the file in a text editor to check for corruption

Performance Issues

If analysis is slow:

  • Reduce Threads - The engine uses half your CPU cores by default
  • Reduce Hash - The engine uses 25% of available RAM
  • Disable Ponder - Turn off thinking during opponent's turn
  • Close Applications - Free system resources

Duplicate Launch Warning

StrikeChess prevents multiple instances:

  • Only one copy can run at a time
  • If you see a warning, close the existing instance first
  • Check system tray/dock for running instances

πŸ“¦ Technical Details

πŸ“¦ Dependencies

StrikeChess requires the following Python packages:

Package Version Purpose
chess ~= 1.11.0 Chess logic and move generation library
psutil ~= 7.1.0 System resource monitoring for engine optimization
PySide6 ~= 6.10.0 Qt-based GUI framework for cross-platform interface

πŸ“₯ Included Software

Stockfish 17.1 chess engine is bundled with StrikeChess:

πŸ“‹ See NOTICE.txt for complete Stockfish licensing information.

πŸ’» Platform Requirements

Requirement Minimum Recommended
Python 3.14 3.14+
OS Windows 10+ / macOS 11+ / Modern Linux Latest stable
RAM 2GB 4GB+ (for analysis)
Storage 50MB 100MB+ (with saved games)

🐍 Why Python 3.14?

StrikeChess uses postponed evaluation of type annotations (PEP 749 & PEP 649), introduced in Python 3.14, which eliminates the need for from __future__ import annotations while maintaining clean, modern Python syntax.

Detailed Installation

1. Install Python 3.14 or newer:

Platform Installation
πŸͺŸ Windows Download Python 3.14 installer
🐧 Linux sudo apt-get install python3.14 (or use your distribution's package manager)
🍎 macOS Download Python 3.14 installer

2. Install dependencies:

pip install -r requirements.txt

🍎 macOS users: Use pip3 instead of pip

3. Launch StrikeChess:

python main.py

🍎 macOS users: Use python3 instead of python

πŸ“¦ Creating a Standalone Executable

1. Install PyInstaller:

pip install pyinstaller

🍎 macOS users: Use pip3 instead of pip

2. Build the executable:

pyinstaller --clean bundle.spec

3. Find your executable:

  • πŸͺŸ Windows: dist/StrikeChess.exe
  • 🐧🍎 Linux/macOS: dist/StrikeChess

πŸ‘¨β€πŸ’» Developing with StrikeChess

πŸ“‚ Project Structure

StrikeChess/
β”œβ”€β”€ main.py              # Application entry point
β”œβ”€β”€ bundle.spec          # PyInstaller build configuration
β”œβ”€β”€ requirements.txt     # Python dependencies
β”œβ”€β”€ LICENSE.txt          # MIT License
β”œβ”€β”€ NOTICE.txt           # Third-party licenses (Stockfish GPLv3)
β”œβ”€β”€ strikechess/
β”‚   β”œβ”€β”€ __init__.py      # Qt resource compilation
β”‚   β”œβ”€β”€ settings.json    # Default settings
β”‚   β”œβ”€β”€ openings.json    # Opening name database
β”‚   β”œβ”€β”€ assets/          # Images, sounds, engines, themes
β”‚   β”œβ”€β”€ services/        # Core game logic
β”‚   β”œβ”€β”€ ui/              # User interface components
β”‚   └── utils.py         # Helper functions

πŸ“ Code Style

The codebase follows:

  • βœ… Type hints throughout for clarity
  • βœ… Descriptive names for variables and methods
  • βœ… PEP 8 style guidelines
  • βœ… Service-based architecture separating concerns
  • βœ… Signal/slot pattern for event handling

πŸ™ Credits

🐍 Python Development

Thanks to all contributors to the Python programming language for creating an ever-evolving ecosystem!

β™ŸοΈ python-chess Library

Kudos to Niklas Fiekas for the excellent python-chess library that powers StrikeChess's game logic!

πŸ–Ό PySide6 Framework

Hats off to the PySide6 team for bringing Qt's powerful GUI framework to Python!

πŸ“Š psutil Library

Shoutout to Giampaolo Rodola for psutil, enabling intelligent resource management!

πŸ† Stockfish Engine

Big thanks to the Stockfish developers for continuously improving the world's strongest open-source chess engine!


πŸ“œ License

StrikeChess is licensed under the MIT License.

See LICENSE.txt for full text.

πŸ”“ Using StrikeChess in Your Project

You're free to use, modify, and distribute StrikeChess under the MIT License. If you create derivative works:

1. Include the original copyright notice:

Copyright (C) 2025 BoΕ‘tjan Mejak
Copyright (C) 2025 Your Name

2. If bundling Stockfish, you must:

  • βœ… Include Stockfish's copyright notice
  • βœ… Include the full GPLv3 license text
  • βœ… Provide access to Stockfish source code

πŸ“‹ See NOTICE.txt for the complete template.

❌ Not Supported

  • Chess variants (Chess960, 3-check, King of the Hill, etc.) are not supported
  • Online play - StrikeChess is designed for local play and analysis only
  • Multiple PGN games - Only one game per PGN file is loaded

πŸ’¬ Support

For bugs, feature requests, or questions:

  • πŸ› Issues: Report problems or suggest improvements
  • πŸ‘ Feedback: Use the thumbs down in issue discussions for bugs you'd like prioritized

⚑ StrikeChess 1.0 - Enjoy your games! ⚑

Made with ❀️ by Boőtjan Mejak

GitHub Python License

About

Play chess against an engine.

Topics

Resources

License

Stars

Watchers

Forks

Languages