Tool to view and solve puzzles from the lichess puzzle database

Overview

offline-chess-puzzles

Tool to view and solve puzzles from the lichess puzzle database.

It's a very simple tool for those who want to practice offline, it has filters by puzzle rating and theme. It might also be helpful to teach the tactical motifs to students, since it's easy to select easy puzzles from a theme, although the current lack of an analysis mode makes it a bit less practical for this use case.

I need to thank lichess for creating the puzzle database (https://database.lichess.org/#puzzles)
and the project "chess-engine" (https://github.com/adam-mcdaniel/chess-engine/) which I used as a starting point for the GUI here.

Usage:

If you will compile the sources yourself, you also need to download the file "lichess_db_puzzle.csv" (from the lichess link above) to the puzzles directory.
Compilation is done with the usual "cargo build" in the project root.

To play you just adjust the search to your needs, press "search" and a puzzle will be loaded, when you get it right the next puzzle will be immediatly displayed.
If the move is a promotion you need to select the piece to promote to in the botton of the screen before moving the pawn.

The search is a bit slow but I think it's important to use the cvs directly so users can easily replace the file if needed.

TODO:

  • Externalize some strings (puzzle db filename, name of the image directory, limit of search results, etc.).
  • Maybe allow the selection of multiple themes at once.
  • Highlight the last move before the puzzle starts (so we can easily see if an en passant is allowed, for example)

License:

Distributed under the MIT License. See LICENSE for more information.

Comments
  • Remember Min, Max, Tactics Theme, Opening

    Remember Min, Max, Tactics Theme, Opening

    I love this software!
    And I like to do the same set of puzzles again and again. For that, it would be very helpful, if on the main page the min and max-rating, the tactics theme and the opening would be remebered after pressing Search. And when I open the program next time, these values should be preset alredy.

    opened by Dumuzy 6
  • "Error: GraphicsAdapterNotFound" when run

    Seems like a iced issue - needs vulkan, which I think I have but still not working. tried to compile with iced/glow, but svg isn't supported... Any tips?

    opened by Camsbury 6
  • Congratulations! New release published. And some suggestions.

    Congratulations! New release published. And some suggestions.

    After waiting for a long time, the new version updated. Hurrah! Thank you very much for your hard work, Brianch!

    The new version: It runs perfectly under win7/10 system. Display the movement of each step, including the last step of the computer which is very useful. When you accidentally clicked the opponent's piece on the board, or when there is no piece, it won't show 'wrong move'.

    As a loyal fan of you, I expect that could you please add some more functions? Such as: 1.Is it possible to add a 'sound/xx.mp3 or xx.wav' folder that can allow users to put in their favorite moves/catch sounds.

    2.Add parameters that can change the color of the board in the 'settings.json' file. For example, I like to use Black: R 134 G 166 B 102 White: R 255 G 255 B 221 image

    3.Is it possible to design the program layout from vertical to horizontal because if the board is set too large, the buttons or labels below cannot be seen. image

    4. Is it possible to add a text box to display the question number? So if a user make a mistake that he may go to the database to see the correct step. image

    5.Please put your paypal or any donation link, that we can cheer you up!

    enhancement 
    opened by Shine0717 4
  • Can't compile under linux

    Can't compile under linux

    After running "build cargo" I get a lot of errors. Just a sample:

    22  | use crate::Device;
        |
    22  | use crate::gles::Device;
        |
          and 1 other candidate
    help: if you import `Device`, refer to it directly
        |
    106 -         let devices = mtl::Device::all();
    106 +         let devices = Device::all();
        |
    
    error[E0283]: type annotations needed
       --> /home/emilio/.cargo/registry/src/github.com-1ecc6299db9ec823/wgpu-hal-0.12.5/src/metal/mod.rs:590:5
        |
    586 | #[derive(Debug, Default)]
        |                 ------- in this derive macro expansion
    ...
    590 |     samplers: Vec<SamplerPtr>,
        |     ^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
        |
        = note: cannot satisfy `_: std::default::Default`
        = note: this error originates in the derive macro `Default` (in Nightly builds, run with -Z macro-backtrace for more info)
    
    Some errors have detailed explanations: E0283, E0425, E0432, E0433.
    For more information about an error, try `rustc --explain E0283`.
    

    The rust version I'm using is "cargo 1.64.0-nightly (a5e08c470 2022-06-23)"

    I'm using an Ubuntu 20.04.4 LTS.

    opened by emdio 3
  • crash under windows10

    crash under windows10

    warning: field is never read: puzzle_db_location --> src\settings.rs:34:5 | 34 | puzzle_db_location: text_input::State, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: #[warn(dead_code)] on by default

    warning: offline-chess-puzzles (bin "offline-chess-puzzles") generated 1 warning Finished dev [unoptimized + debuginfo] target(s) in 3m 42s Running target\debug\offline-chess-puzzles.exe error: process didn't exit successfully: target\debug\offline-chess-puzzles.exe (exit code: 0xc0000005, STATUS_ACCESS_VIOLATION)

    opened by skydig 2
  • Stats for Puzzle solved

    Stats for Puzzle solved

    Would be nice to have statistics for puzzles attempted/solved across various categories calculated rating based on solved/attempts for such categories. Ability to reset statistics and start all over again

    opened by nswami15 1
  • Make Board Flippable

    Make Board Flippable

    I love this software! And I like to do sets of puzzles with a flipped board from time to time. So as to maybe better learn what the opponent is threatening me. I would therefore like to have a little checkbox which makes the board flip around. This should be on the main page. And maybe it should be remembered for the next time I open the program. Just for consistency, when all the other stuff is remembered.

    enhancement 
    opened by Dumuzy 1
  • vcruntime140.dll needed in win7 and on win10 the labels sometimes are not shown correctly

    vcruntime140.dll needed in win7 and on win10 the labels sometimes are not shown correctly

    Congratulations Brianch has released the new version!

    Since the last version was released, I have checked it out almost every day. Whenever I see the "code" page, it shows modified "a few hours, or days", I am very excited. Thank you very much for your hard work, Brianch.

    After version of 2.0, I've been a little busy at work this month, so I didn't play it very often.

    I tried it on the win7, and it noticed me that a 'VCRUNTIME140.dll' file is missing. I guess its my computer's problem.

    But when I tried it on win10 system, sometimes there are strange "patterns" on the screen. I don't know if this is my computer's problem. Anyway it's not a big problem, you don't need to fix it in hurry. strange

    opened by Shine0717 5
Releases(v2.1.0)
  • v2.1.0(Oct 4, 2022)

    As before, I didn't include the puzzle database in the release files, please download it from the lichess site: https://database.lichess.org/lichess_db_puzzle.csv.bz2, extract the ".csv" file and put it in the "puzzles" directory.

    The opengl version inside the zip files is what I had previously called windows 7 version, it's for systems that don't have Vulkan or DirectX 12, the pieces look worse because we have to use a regular font to display them (instead of images), but other than that, the functionality is the same.

    The number of puzzles classified by opening is still not very big, you can take a look at the lichess page to have an idea of how many are there. In this app the filter is just by opening family, not subvariations.

    The Linux binaries I'm providing here were tested in Linux Mint 20.1 and Arch Linux. I don't know if they will work in other systems but the compilation is pretty straightforward in case you have to compile it yourself.

    Changes:

    • Fixed compatibility with the current lichess db (with the old version, some puzzles would be ignored due to the introduction of a couple opening fields in the database)
    • Added a filter by opening (including the side to play)
    • Added an option to not automatically load the next puzzle
    • Added a button to redo the puzzle
    • Added a takeback button in the analysis mode

    Minor changes:

    • Now it's visually clear which is the piece selected for promotion
    • The puzzle link is shown and is selectable (previously we were just displaying the puzzle ID)
    • Added the Gothic A1 font for the pieces in the opengl version, alongside the GNU Freefont that we had used before

    Known issues:

    • In old Windows versions (7/8), you may have to install the vcruntime140 dll (in this case there will be an error message complaining about it's absence), this dll can be obtained from Microsoft's website.
    Source code(tar.gz)
    Source code(zip)
    offline-chess-puzzles-linux-64bit.zip(11.51 MB)
    offline-chess-puzzles-windows-32bit.zip(9.16 MB)
    offline-chess-puzzles-windows-64bit.zip(9.43 MB)
  • v2.0.0(Sep 30, 2021)

    Important:

    I won't be including the puzzle database in the release files anymore, please download it from the lichess site: https://database.lichess.org/lichess_db_puzzle.csv.bz2, extract the ".csv" file and put it in the "puzzles" directory.

    This way requires you a bit of manual work but on the other hand it makes sure the file is updated and you won't need to download again if you already have it.

    Changes:

    • Horizontal layout with tabs
    • Puzzle information is displayed (game link, fen, rating, themes, etc.)
    • Sound for moves (can be turned off)
    • Basic analysis mode (let you freely move the pieces)
    • Hint (highlight the piece that should be moved)
    • Different piece and board themes
    • Includes also 32-bit versions for Windows

    Windows:

    The "windows7" and "windows10" in the name in kind of an approximation:

    • The version for windows 7 should also work in 8 / 8.1 and is for systems that don't have Vulkan or DirectX 12. The pieces look considerably worse and you can't change them but other than that the functionality is the same.
    • The Windows 10 version should be preferred if it works in your system, since it looks way better.

    Linux:

    The binary file I'm providing here was compiled in Linux Mint and tested there and in Arch Linux. I don't know if it will work in other systems but the compilation is pretty straightforward in case you have to compile it yourself.

    Source code(tar.gz)
    Source code(zip)
    offline-chess-puzzles-2.0.0-linux.tar.gz(7.13 MB)
    offline-chess-puzzles-2.0.0-windows10.zip(8.25 MB)
    offline-chess-puzzles-2.0.0-windows7.zip(6.62 MB)
  • v1.1.0(Aug 23, 2021)

    General changes/fixes:

    • Highlight last move (very useful to see if en passant is allowed).
    • Added a config file (settings.json) to change board size, puzzle db location, piece theme (name the images the same way as the merida ones and set the directory name in the config file) and search results limit. This will (hopefully) be made easier in the future but at least a temporary way to change these things was needed right now.
    • Doesn't crash anymore when all the search results are solved.

    Minor changes:

    • Removed a theme option ("of-player") that didn't make sense for this app.
    • Include the side to move in the "Wrong move" message (for the cases when you click too fast by mistake and miss it).
    • Don't start the selection if the click isn't on a piece from the side to move.

    Windows:

    • Doesn't open a command prompt window anymore.
    • Added another .exe (named "offline-chess-puzzles-win7.exe") for windows versions older than Windows 10. The piece theme can't be changed and is quite ugly (it uses a font and not images) but other than that, the functionality is the same.

    Linux:

    • First binary release. The AppImage file is self-contained as it's supposed to be but if you want/need you can put a settings.json file (like the one in the repository) in the same directory to change things. It was tested on Arch Linux and Linux Mint 20.1.
    Source code(tar.gz)
    Source code(zip)
    offline-chess-puzzles-1.1.0-windows.zip(109.08 MB)
    Offline-chess-puzzles-1.1.0-x86_64.AppImage(108.90 MB)
  • v1.0.0(Jul 8, 2021)

    This is the first release, there's a lot of things that could be improved but it's already fully functional (the zip also includes the lichess puzzle db, so no need to manually download it yourself).

    I'm doing this Windows release first both because in Linux we're more used to compiling things ourselves and also because I still need to check how exactly I should distribute Linux binaries.

    Source code(tar.gz)
    Source code(zip)
    offline-chess-puzzles.zip(105.80 MB)
Owner
null
Data-oriented and data-driven game engine written in Rust

What is Amethyst? Amethyst is a data-driven and data-oriented game engine aiming to be fast and as configurable as possible. Principles These principl

Amethyst Engine 7.9k Dec 31, 2022
Minesweeper game developed with Rust, WebAssembly (Wasm), and Canvas

?? click here to play the game ?? Minesweeper game Revealing all the cells without hitting the mines is the task. Each number in the cell denotes how

Karthik Nedunchezhiyan 23 Dec 28, 2022
Pong-like videogame made with Rust and Bevy

Rust pong Pong-like videogame made with Rust and Bevy Features Correct Physics AI Score Wasm TO DO Score Wasm Multiplayer How to run For the desktop v

Hector Pulido 6 Aug 22, 2022
A minesweeper game with a terminal and graphical interface

Mine A minesweeper game with a terminal and graphical interface created by Koen Westendorp. Installation Go ahead and try out for yourself! :) git clo

Koen Westendorp 3 Dec 22, 2022
A Rust library and cli for Wordle. Inspired by Wordle in Bash

A Rust library and cli for Wordle. Inspired by Wordle in Bash

Himanshu Neema 9 Dec 18, 2022
A block game made in Rust and SFML

septadrop A block game made in Rust and SFML. For packaging instructions, see the build folder. Game Controls ??/?? arrow keys: horizontal movement ??

Elnu 1 Dec 19, 2022
Match up block edges and get your center of mass as low as possible. World of Goo meets dominoes!

Excavation Site Alpha Match up block edges and get your center of mass as low as possible. World of Goo meets dominoes! Drag blocks off the conveyor b

petrak@ 2 Oct 12, 2022
Planetoid is a toy project to demonstrate and learn several technologies. The goal is to create a little multiplayer asteriod game clone.

Planetoid is a toy project to demonstrate and learn several technologies. The goal is to create a little multiplayer asteriod game clone.

René Ribaud 8 Aug 23, 2022
Fish Game for Macroquad is an online multiplayer game, created as a demonstration of Nakama, an open-source scalable game server, using Rust-lang and the Macroquad game engine.

Fish Game for Macroquad is an online multiplayer game, created as a demonstration of Nakama, an open-source scalable game server, using Rust-lang and the Macroquad game engine.

Heroic Labs 130 Dec 29, 2022
A space shooter game made with Amethyst and Rust.

Theta Wave Project Introduction This game was made with the Amethyst engine. It is inspired by games like Raiden and The Binding of Isaac. Game Introd

Theta Wave 192 Oct 7, 2022
Mk48.io is an online multiplayer naval combat game, in which you take command of a ship and sail your way to victory

Mk48.io Game Mk48.io is an online multiplayer naval combat game, in which you take command of a ship and sail your way to victory. Watch out for torpe

Softbear Studios 160 Jan 2, 2023
An application that tries to solve a Wordle puzzle only by using clues

wordlebot An application that tries to solve a Wordle puzzle only by using clues. You decide the word to discover (if you want to compete with wordleb

Rich Neswold 2 May 25, 2022
Terminal UI for leetcode. Lets you browse questions through different topics. View, solve, run and submit questions from TUI.

Leetcode TUI Use Leetcode in your terminal. Why this TUI: My motivation for creating leetcode-tui stemmed from my preference for tools that are lightw

Akarsh 8 Aug 10, 2023
A Discord bot for lichess and Rosen related things

liro Liro is a Discord bot that follows in the footsteps of Lichess-discord-bot, without necessarily aiming to replace it. The main pain point that th

Sebastian Lauwers 5 Feb 16, 2022
A Distributed SQL Database - Building the Database in the Public to Learn Database Internals

Table of Contents Overview Usage TODO MVCC in entangleDB SQL Query Execution in entangleDB entangleDB Raft Consensus Engine What I am trying to build

Sarthak Dalabehera 38 Jan 2, 2024
Opening explorer for lichess.org

lila-openingexplorer3 Personal opening explorer under development. Usage EXPLORER_LOG=lila_openingexplorer3=debug cargo run --release -- --lila https:

Niklas Fiekas 5 Dec 29, 2021
Advent of Code 2021 puzzles & solutions in Rust

Advent of Code 2021 These are puzzles for the Advent of Code 2021 challenge, written and solved in the Rust programming language. The puzzle for each

Chevy Ray Johnston 8 Dec 19, 2021
handle some lichess.org/tournament load with rust, while learning rust

lila-http Take some of the HTTP load away from lila. WIP! Arena tournaments Clients connected to a tournament page request new data about the tourname

Thibault Duplessis 22 Jan 2, 2023
Handle some lichess.org/tournament load with Rust, while learning Rust

lila-http Take some of the HTTP load away from lila. WIP! Arena tournaments Clients connected to a tournament page request new data about the tourname

Lichess 22 Jan 2, 2023
Solutions to Advent of Code 2022 puzzles

Solutions to Advent of Code 2022 puzzles

null 3 Dec 15, 2022