Chess GUI

Overview

Lucas Chess

Lucas Chess is a GUI of chess:

  1. To learn to play chess.
  2. To play chess against engines.

Dependencies

  • Python 2.7
  • PyQt4
  • PyAudio
  • psutil
  • Python for windows extensions
  • chardet
  • python-chess
  • pyllow
  • photohash
  • cython
  • scandir

Links

Legal Details

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 2 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.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

See the file "copying.txt" for details.

Comments
  • Exceptions and stuff (was Clicking on

    Exceptions and stuff (was Clicking on "Show tutor" sometimes ignored).

    Sometimes when a tutor suggest a better move clicking on There are XXX best moves -> Show tutor just ignored.

    I made this changes (marked with # <--) to GestorEntMaq.py to see wtf is going on:

                        if siTutor:
                        
                            sys.stderr.write("TUTORR!") # <--
                        
                            tutor = Tutor.Tutor(self, self, jg, desde, hasta, False)
    
                            if self.aperturaStd:
                                liApPosibles = self.listaAperturasStd.listaAperturasPosibles(self.partida)
                            else:
                                liApPosibles = None
                            sys.stderr.write("1") # <--
                            if tutor.elegir(self.ayudas > 0, liApPosibles=liApPosibles):
                                sys.stderr.write("2") # <--
                                if self.ayudas > 0:  # doble entrada a tutor.
                                    sys.stderr.write("3") # <--
                                    self.reponPieza(desde)
                                    self.ayudas -= 1
                                    desde = tutor.desde
                                    hasta = tutor.hasta
                                    coronacion = tutor.coronacion
                                    siBien, mens, jgTutor = Jugada.dameJugada(self.partida.ultPosicion, desde, hasta, coronacion)
                                    if siBien:
                                        sys.stderr.write("4") # <--
                                        jg = jgTutor
                                        self.setSummary("SELECTTUTOR", True)
                            else:
                                sys.stderr.write("self.ayudas: " + str(self.ayudas) + "\n") # <--
                                sys.stderr.write("self.aperturaStd: " + str(self.aperturaStd) + "\n") # <--
                                sys.stderr.write("liApPosibles: " + str(liApPosibles) + "\n") # <--
                            sys.stderr.write("5") # <--
                            if self.configuracion.guardarVariantesTutor:
                                sys.stderr.write("6") # <--
                                tutor.ponVariantes(jg, 1 + self.partida.numJugadas() / 2)
    
                            del tutor
                            sys.stderr.write("7\n") # <--
    

    Here is the result:

    TUTORR!1234567
    TUTORR!1234567
    TUTORR!1234567
    TUTORR!1234567
    TUTORR!1234567
    TUTORR!1self.ayudas: 2
    self.aperturaStd: None
    liApPosibles: None
    567
    

    So in a normal case it went through all the branches, in case of error it breaks with self.aperturaStd==None. I have no idea what that means.

    opened by tico-tico 37
  • Ubuntu 18.04 installation error.

    Ubuntu 18.04 installation error.

    File "Lucas.py", line 44, in import Code.Init File "./Code/Init.py", line 4, in from Code import Util File "./Code/Util.py", line 17, in import scandir ImportError: No module named scandir

    Scandir issue is resolved.

    Can someone help me out in this. I tried installing Lucaschess in ubuntu 18.04 and this error came up. python Lucas.py gives me this now:

    Traceback (most recent call last): File "Lucas.py", line 44, in import Code.Init File "./Code/Init.py", line 5, in from Code import Procesador File "./Code/Procesador.py", line 6, in from Code import AperturasStd File "./Code/AperturasStd.py", line 1, in import LCEngine4 as LCEngine ImportError: No module named LCEngine4


    opened by Arunachala-Ramana 21
  • The 'tutor' re-analyses your moves after you take a move back

    The 'tutor' re-analyses your moves after you take a move back

    (Tenative) Steps to reproduce:

    with the tutor on, make a move (or perhaps it has to be one that the tutor faults); take the move back (and perhaps one needs to do this not via the tutor pop-up window, but in the normal fashion); the tutor then re-analyses the move, or at least something stalls the system.

    Windows 8.1. Lucas Chess 11.07a

    Screenshot (in case it is of use):

    image

    opened by ghost 17
  • Linux: Installation issues solved + game hangs when engines are used solved

    Linux: Installation issues solved + game hangs when engines are used solved

    Hi, thanks for the great work!

    I have managed to install 11.04a on Linux 32-bit (with some issues, see below). The game starts up and I can do options and trainings. However it seems to hang immediately when a chess engine is used:

    1. Play against Kids engine: Hangs (Black Hand) after choosing white or black, for any engine chosen.
    2. compete: engines Roccinante, tutor mcbrain or stockfish: first 2-3 moves are alright but as soon it gets out of the book it hangs (Black hand). Checking the process list I never found any process of a chess engine running. Maybe loading of engines fails. Maybe this has to do with the issues I had during Linux 32-bit installation:

    My Installation installation process & issues:

    1. System is an 32-bit ubuntu derived distro, modern (2017) kernel etc.
    2. I followed the advice given in Linux/LinuxInstallation.md. However that file seems to be truncated on the 64-bit explanation and has no explanation on 32 bit at all.
    3. I copied all files to /usr/local/share/lucaschess. In ./Engines I deleted all windows and linux 64 bit folders. BTW: In the linux32 bit folder, in cheng, there seems to be an 64-bit engine only.
    4. I did the chmod 777
    5. I ran the package install xlinux_install.sh . There I had two observations: a) it seems that pip should be called without sudo - with sudo there are warnings about different user and access rights b) the package python-chess was not available as an apt package. Actually it is a python module and I was able to identify it on e.g. pypi.org and install it using 'pip install python-chess'
    6. I started using Linux/xlucas.sh . I got the runtime error in DBgames.py xpv2pgn no member of LCEngine. To fix this I re-compiled LCEngine and libirina doing the steps indicated for 64-bit in LinuxInstallation.md plus running xcython_linux.sh:
    • cd LCEngine/irina
    • ./xmk_linux.sh
    • cd LCEngine
    • ./xcython_linux.sh #copies over to Engines/_tools/Linux32..
    1. After this lucaschess started up without any complaints, however it hangs as soon as an eninge is required.
    opened by Costor 16
  • 10.10.3 always plays same opening . .

    10.10.3 always plays same opening . .

    . . even when I have set the opening to 'undetermined'. The computer always opens with nf3 or, as black against e3, always plays Nf6. The problem occurs with the Deep Tonga engine and one other engine that I tried.

    opened by ghost 13
  • Lucaschess not running after upgrading to ubuntu 20.04

    Lucaschess not running after upgrading to ubuntu 20.04

    Recently upgraded my system and tried installing lucaschess again.

    I seem to get the error when i run the command bash xmk_linux.sh. This is the error

    lc.c: In function ‘pgn2pv’:
    lc.c:169:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      169 |             if( promotion ) sprintf(pv, "%s%c", pv, promotion);
          |             ^~
    lc.c: In function ‘getMove’:
    lc.c:211:5: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      211 |     if( move.promotion ) sprintf(pv, "%s%c", pv, tolower(NAMEPZ[move.promotion]));
          |     ^~
    lc.c: In function ‘getMoveEx’:
    lc.c:255:5: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      255 |     sprintf(info, "%s%c%c%c", info, promotion, castle, en_passant);
          |     ^~~~~~~
    lc.c: In function ‘toSan’:
    lc.c:288:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      288 |             sprintf(sanMove, "%s=%c", sanMove, toupper(NAMEPZ[move.promotion]));
          |             ^~~~~~~
    lc.c:306:9: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      306 |         if( is_amb_ah ) sprintf(sanMove,"%s%c", sanMove, POS_AH[move.from][0]);
          |         ^~
    lc.c:307:9: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      307 |         if( is_amb_18 ) sprintf(sanMove,"%s%c", sanMove, POS_AH[move.from][1]);
          |         ^~
    lc.c:308:9: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      308 |         if(move.capture) sprintf(sanMove,"%sx", sanMove);
          |         ^~
    lc.c:309:9: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      309 |         sprintf(sanMove,"%s%s", sanMove, POS_AH[move.to]);
          |         ^~~~~~~
    lc.c:316:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      316 |             sprintf(sanMove,"%s#", sanMove);
          |             ^~~~~~~
    lc.c:318:13: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      318 |             sprintf(sanMove,"%s+", sanMove);
          |             ^~~~~~~
    board.c: In function ‘board_fen’:
    board.c:250:5: warning: passing argument 1 to restrict-qualified parameter aliases with argument 3 [-Wrestrict]
      250 |     sprintf(fen, "%s %d %d", fen, board.fifty, board.fullmove);
          |     ^~~~~~~
    util.c: In function ‘get_ms’:
    util.c:53:5: warning: ‘ftime’ is deprecated [-Wdeprecated-declarations]
       53 |     ftime(&buffer);
          |     ^~~~~
    In file included from util.c:2:
    /usr/include/x86_64-linux-gnu/sys/timeb.h:39:12: note: declared here
       39 | extern int ftime (struct timeb *__timebuf)
    

    Not sure what i have done wrong and it would be nice if somebody can help.

    opened by Arunachala-Ramana 9
  • Transsiberian railway broken

    Transsiberian railway broken

    While doing some tactics I looked at saving the puzzle via Options. No I can no longer get into tactics. Selecting 'Play' returns me to the main screen. Can I fix this without restarting?

    I now this was a coincidence. The supplied tactics file was incorrect.

    opened by DavidParkin 8
  • Kibitzers stop working (training - openings - with book)

    Kibitzers stop working (training - openings - with book)

    I'm not sure if this is specific to openings training, but Kibitzers generally don't work in this mode - I had some luck using a kibitzer based on Stockfish, but not with others, e.g Komodo 32bit. Once I add first kibitzer and it works (stockfish), it opens a kibitzer window, but then when I add kibitzer (komodo), it doesn't show and also the first one disappears. Restarting lucachess doesn't help, I cannot start any of the created kibitzers in openings training. I have to remove the definitions of both kibitzers using Kibitzer -> Remove...

    opened by stolowski 8
  • Feature request: have option not to move the King automatically when his move is forced

    Feature request: have option not to move the King automatically when his move is forced

    In Lucas Chess 11.17, and unless I make some mistake, if I must move my King - because of check, say - and can move him to only one square, then, upon touching the King, the computer moves him. I would like an option to disable that automatic moving.

    opened by LinuxOnTheDesktop 7
  • Better bug logging (immediate saving).

    Better bug logging (immediate saving).

    For now tracebacks are flushed to disk only after you close the program. It really inconvenient for catching bugs. All tracebacks should be saved immediately. When I played with https://github.com/lukasmonk/lucaschess/issues/29 I had to make some changes to Init.py.

    DEBUG = False
    VERSION = "10.11"
    
    import os
    import sys
    
    from Code.Constantes import *
    
    if DEBUG:
        prlkn("DEBUG " * 20)
    
    from Code import VarGen
    from Code import Procesador
    from Code import Sonido
    
    from Code.QT import Gui
    
    class loghelper:
        def __init__(self, logname):
            self.logname = logname
        def write(self, buf):
            ferr = open(self.logname, "at", 0)
            ferr.write(buf)
            ferr.close()
    
    def init():
        if not DEBUG:
            sys.stderr = loghelper("bug.log")
    
        mainProcesador = Procesador.Procesador()
        mainProcesador.setVersion(VERSION)
        runSound = Sonido.RunSound()
    	
    [...snip...]
    
    And remove this
        if not DEBUG:
            if okFerr:
                ferr.close()
    
    [...snip...]
    

    But I'm really bad at Python so I guess you can invent better solution.

    opened by tico-tico 7
  • Multiple problems with the Linux version

    Multiple problems with the Linux version

    Sadly, the native Linux version runs much worse on my system (Mint 18 Cinnamon) than does the Windows version under Wine (on the same system).

    For, on the native version:

    1. configuration windows open behind the main one;
    2. the program does not restart when it is meant to;
    3. startup is slow and indeed in general the problem is slow (why? why slower than under Wine?);
    4. I experienced a hang when it was the computer's move during a game.
    opened by ghost 7
  • Setting up a position and then playing it (1) is rather complex, (2) changes the animations speed; more

    Setting up a position and then playing it (1) is rather complex, (2) changes the animations speed; more

    On Lucas Chess 11.15b (note: it would be useful were the version information available from the program mid-game - call that problem '0'), (1) to set up a position and play it seemingly one needs to do: tools -> create your own game -> arrange position -> (wonder what to do, and) -> Utilities -> Play game -> choose colour.

    (2) When one starts playing, the animation speed seems to have changed from what it normally is (at least if one has changed the default - and one presumes, though falsely, global animation speed). This is jarring.

    Please note finally that (3) trying to adjust the starting position, after one has started playing, if unintuitive and fiddly. One problem (3a) is a path box which one expects to be able to type into, but which, upon being clicked, opens a finder window. Another problem (3b) is that to save changes one needs to make them and then manage to locate a rather small, somewhat hidden little save icon.

    Finally (4) somehow I ended up with three windows each showing their own board. At this point I was boggled and closed the program (by finding and closing all the windows).

    All in all: a lot of 'papercuts' here. Indeed 4 is more than a papercut.

    opened by LinuxOnTheDesktop 0
  • Feature request: have a live analysis feature like in lichess

    Feature request: have a live analysis feature like in lichess

    I find this feature in lichess so simple yet so helpful for learning ... I'm currently practicing with 'create your own game' but I think this feature would be more helpful for beginners like me

    Screenshot 2021-03-05 223339

    opened by rayatc 1
  • Wait pointer shows when it is my move

    Wait pointer shows when it is my move

    In the situation shown below, and at other times in the same game, the wait pointer - the hand - shows when it is my move.

    image

    Now admittedly perhaps some tutor option I choose caused this. For, when the options are displayed, I cannot see them. Screenshot:

    image

    I suppose resetting my theme to default would fix that latter problem.

    I am happy to provide further details.

    LucasChess 11.18.

    opened by LinuxOnTheDesktop 0
  • Options windows, and especially the Initial Moves window, are rather small

    Options windows, and especially the Initial Moves window, are rather small

    The Initial Moves window - to give details only about that (but see also #130) is rather small on my main PC - it looks like this:

    image (I show that Initial Moves window against something other than the main LucasChess window, because when I open the Initial Moves window, the main window disappears.)

    Also, on a laptop (with x2 HiDPI scaling, if that matters, and running LucasChess under Wine), the Initial Moves window is, if anything, slightly smaller! The smallness of the window make it hard to use.

    Thank you for LucasChess.

    opened by LinuxOnTheDesktop 5
  • Live analysis output?

    Live analysis output?

    In many chess GUIs, like in Arena, you get to see the live output of the engine as it's analyzing. In Lucas Chess, you're only able to see the results after manually running it for a certain depth.

    opened by anonymous7002 3
Releases(v11,17)
Chesston (Chess+Python) is a two-player chess game with graphical user interface written in PyQt5

♟️ Chesston (Chess+Python) is a two-player chess game with graphical user interface written in PyQt5. ?? Dependencies This program uses Py

null 6 May 26, 2022
Chess GUI

Lucas Chess Lucas Chess is a GUI of chess: To learn to play chess. To play chess against engines. Dependencies Python 2.7 PyQt4 PyAudio psutil Python

Lucas 322 Dec 20, 2022
SuperChess is a GUI application for playing chess.

About SuperChess is a GUI application for playing chess. It is written in Python 3.10 programming language, uses PySide6 GUI library, python-chess lib

Boštjan Mejak 1 Oct 16, 2022
Chess - A python gui application

Chess Python version 3.10 or greater is required to play. Note This is a gui application, and as such will not run inside WSL.

Jonxslays 1 Dec 16, 2021
A didactic GUI chess game made in Python3 using pygame.

Chess A didactic GUI chess game made in Python3 using pygame. At the moment, there is no AI. The only way you can test the game is by playing against

Leonardo Delfino 1 Dec 22, 2021
A Neural Network based chess engine and GUI made with Python and Tensorflow/Keras.

Haxaw-Chess Haxaw: Haxaw is the Neural Network based chess engine made with Python and Tensorflow/Keras. Also uses the python-chess library. (WIP: Imp

Sarthak Bharadwaj 8 Dec 10, 2022
PyChess - a chess client for Linux/Windows

PyChess - a free chess client for Linux/Windows The mission of PyChess is to create a free, pleasant, PyGObject based chess game for the Linux desktop

null 559 Dec 28, 2022
A base chess engine that makes moves on an instance of board.

A base chess engine that makes moves on an instance of board.

null 0 Feb 11, 2022
This a Chess PGN saver which allows you to save your game pgns, in a .pgn file

PGN Saver This a Chess PGN saver which allows you to save your game pgns, in a .pgn file This can be a very useful tool for the people using chessbase

null 3 Jan 6, 2022
In the works, creating a new Chess Board and way to Play...

sWJz4KingsChess date started on github.com 11-13-2021 In the works, creating a new Chess Board and way to Play... starting to write this in Pygame, an

Shawn 2 Nov 18, 2021
Running Chess Night results tabulation

Running Chess Night results tabulation

Mitch LeBlanc 2 Nov 20, 2021
A playable version of Chess – classic two-player, various AI levels, and the crazyhouse variant! Written in Python 3

A playable version of Chess – classic two-player, various AI levels, and the crazyhouse variant! Written in Python 3. Requires the installation of PIL/Pillow and Requests

null 1 Dec 24, 2021
Visualizing and learning from games on chess.com

Better Your Chess What for? This project aims to help you learn from all the chess games you've played online, starting with a simple way to download

Luc d'Hauthuille 0 Apr 17, 2022
j-chess implementation in python

j-chess-client-python This repository aims to be a starting point for implementing a chess ai for the j-chess-server in python. To start, you can copy

Jonas 1 Dec 25, 2021
Python code that gives the fastest path from point a to point b of a chess horse

PERSONAL-PROJECTS CARLOS MAGALLANES-ARANDA'S PERSONAL PROJECTS kchess.py is the code. its input is the start and the end. EXMPLE - a1 d5 its output is

Carlos Magallanes-Aranda 1 Dec 26, 2021
Chess turnament organizer (short construct concept)

Turnament Organizer Chess turnament organizer (short construct concept). It is my hobby app I want to write to support lightweight tool for smart roun

kkuba91 3 Dec 16, 2022
Chess Game using Python

Chess Game is a single-player game where the objective is same as the original chess game. You just need to place your chess piece in a correct position. The purpose of the system is to provide some past time with your friends.

Yogesh Selvarajan 1 Aug 15, 2022
A chess engine with basic AI capabilities (search for best move using MinMax algorithm)

A chess engine with basic AI capabilities (search for best move using MinMax algorithm)

Ken Wu 1 Feb 2, 2022
A Gomoku game GUI using pygame where the user can choose to play against another player or an AI using minimax with alpha-beta pruning

Gomoku A GUI based Gomoku game using pygame where the user can choose to play against another player or an AI using minimax with alpha-beta pruning. R

Mingyu Liu 1 Oct 30, 2021