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)
Finding a method to objectively quantify skill expression in games, using reinforcement learning

Analyzing Skill Expression in Games This is a repo where I describe a method to measure the amount of skill expression games have. Table of Contents M

Marcus Chiam 4 Nov 19, 2022
A Game Engine Made in Python with the Pygame Module

MandawEngine A Game Engine Made in Python with the Pygame Module Discord: https://discord.gg/MPPqj9PNt3 Installation To Get The Latest Version of Mand

Mandaw 14 Jun 24, 2022
Simple wordle clone + solver + backtesting

Wordle clone + solver + backtesting I created something. Or rather, I found about this game last week and decided that one challenge a day wasn't goin

1 Feb 08, 2022
Simulate a Monopoly game to generate the probabilities of landing on each square.

Monopoly-Probabilities Simulate a Monopoly game to generate the probabilities of landing on each square. While this project originally was inspired by

George Waters 2 Jan 04, 2023
Game-of-life - A simple python program to simulate and visualise the Conway's Game of life

Conway's game of life A simple python program to simulate and visualise the Conw

Dhravya Shah 3 Feb 20, 2022
MinMax Algo , Python

Write a PYTHON program to play the game of TIC-TAC-TOE on a 3×3 board with alternate inputs from user and computer.

Naman Anand 1 Nov 26, 2021
CoinTex: Cross-platform Multi-Level Game created in Python using Kivy

CoinTex: Cross-platform Multi-Level Game created in Python using Kivy CoinTex is a multi-level adventure game created using the Kivy cross-platform Py

Ahmed Gad 57 Dec 11, 2022
Text-Adventure-Game [Open Source] A group project by the Python TASK Force

Text-Adventure-Game [Open Source] A group project by the Python TASK Force

Mircea Dumitrescu 2 Sep 17, 2021
Memory game in Python

Concentration - Memory Game Concentration is a memory game written in Python, inspired by memory-game. Description As stated in the introduction of th

Marco Colonna 0 Jul 21, 2022
Flappy bird using Pygames

flappy-bird Esse é um jogo que eu fiz utilizando a biblioteca de jogos do Python

Leandro Henrique 2 Jan 05, 2022
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

1 Dec 24, 2021
Searches the word list in Wordle based on search pattern.

Wordle Searcher Searches the word list in Wordle based on search pattern. Warning: like all forms of cheating, it trivializes the game, and robs you o

Tyler Martin 1 Jan 29, 2022
Snake game made in python with the pygame library.

Pygame snake Snake game made in python with the pygame library. Requirements pip pygame Pygame Installation On the command line, type: pip install pyg

Ayza 3 Oct 02, 2022
A two-player strategy game played on a rectangular grid made up of smaller square cells of chocolate 🍫 or cookies 🍪

Chomp Game ©️ Chomp is a two-player strategy game played on a rectangular grid made up of smaller square cells of chocolate 🍫 or cookies 🍪 , which c

Farivar Tabatabaei 2 Feb 02, 2022
An algorithm to reach a correlated equilibrium in multiplayer games.

Correlatedpy: a python library for distributed learning of correlated equilibrium in multiplayer strategic games. View Demo · Report Bug · Request Fea

Omar Boufous 2 Feb 01, 2022
Inject custom C++ code into GameMaker Studio 2 YYC builds

YYC Boost Inject custom C++ code into GameMaker Studio 2 YYC builds! WARNING: This tool is currently in an early stage of development and it is not gu

Patrik Kraif 7 Dec 30, 2022
View your VALORANT performance in different areas of every map in the game!

Valorant-Zone-Stats Inspired by Leetify's awesome Map Zones Tool for CS:GO A simple desktop program to view your VALORANT performance in different are

Louis 76 Jan 01, 2023
An old time game Tic-Tac-toe

A Tic Tac Toe Bot This is the code repository for my article on Medium - Playing Games with Python - Tic Tac Toe, where I have tried to take the famou

Jigyanshu 0 Feb 25, 2022
Wordle-helper: python script to help solving wordle game

wordle-helper This is a python script to help solving wordle game 5-letter-word-

MD Nur Ahmed 2 Feb 08, 2022
Wordle-prophecy - The comprehensive list of all Wordle answers, past and future

About This repo contains the comprehensive list of all Wordle answers, past and

Hayden Moritz 2 Dec 15, 2022