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)
Pygame Raycaster made by me.

Pygame Raycaster made by me.

Sable 0 Jan 10, 2022
A minimal open source mtg-like tcg game made in python that can be played on a terminal emulator using a keyboard.

A minimal open source mtg-like tcg game made in python that can be played on a terminal emulator using a keyboard.

Amos 3 Aug 29, 2021
Logo hitting the corner == best feeling ever!

Bouncing DVD logo - Pygame A little ride back to the 90s. Ah good ol' time! Didn't we all wait for the logo to hit the corners? Best feeling ever!! I

Hoang Nguyen 3 May 25, 2022
Lutris helps you install and play video games from all eras and from most gaming systems.

Lutris Lutris helps you install and play video games from all eras and from most gaming systems. By leveraging and combining existing emulators, engin

Pop!_OS 2 Nov 15, 2021
A "finish the lyrics" game using Spotify, YouTube Transcript, and YouTube Search APIs, coupled with visual machine learning

Singify Introducing Singify, the party game! Challenge your friend to who knows songs better. Play random songs from your very own Spotify playlist an

Josh Wong 4 Nov 19, 2021
A Minecraft clone written in python and pyglet.

PyCraft A Minecraft clone written in python and pyglet. Running PyCraft To run PyCraft, run the following code: git clone https://github.com/TheWebCra

The WebCrafters 17 Dec 29, 2022
PyCraft - A Minecraft launcher made in python

A Minecraft launcher made in python. The main objective of this launcher is to enable players to enjoy minecraft (especially those without a mojang/microsoft account). This launcher is not illegal as

38 Dec 12, 2022
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
Graphical impimetaion of Conway's Game of Life in Python using pyglet

Conway's Game of Life in Python Konstantin Opora Conway's Game of Life: graphical implementation in python using pyglet. developed in Python 3.10.0 Re

Konstantin Opora 1 Nov 30, 2021
Just to play with my kids: create a secret alphabet and exchange encrypted messages

Secret Alphabet Description This project allows you to randomly generate an alphabet (a set of characters) and its corresponding translation. For the

BS 1 Nov 12, 2021
For educational purposes, a simple script that assists in solving the word game Wordle.

WordleSolver For educational purposes, a simple script that assists in solving the word game Wordle. Instructions Pick your first word from the sugges

Christian De Leon 2 Mar 25, 2022
Chess game for 2 players with UI

2-D Chess for 2 players Overview This is a simple 2D Chess game for 2 players using pygame library. Requirements To be able to run this game, you must

7 Apr 06, 2022
Vitrix is an open-source FPS video game coded in python

Vitrix is an open-source FPS video game coded in python Table of contents Usage Game Server Installing Requirements Hardware Requirements Software Req

Vitrix 1 Feb 13, 2022
The repository that hosts the code that teaches a reinforcement learning - based bot to play 2048

The repository that hosts the code that teaches a reinforcement learning - based bot (based on policy gradients method) to play 2048

Maxim Rud 1 Dec 16, 2021
Minecraft clone using Python Ursina game engine!

Minecraft clone using Python Ursina game engine!

Taehee Lee 35 Jan 03, 2023
A terminal-based number guessing game written in python

A terminal-based number guessing game written in python

Akshay Vs 15 Sep 22, 2022
linorobot2 is a ROS2 port of the linorobot package

linorobot2 is a ROS2 port of the linorobot package. If you're planning to build your own custom ROS2 robot (2WD, 4WD, Mecanum Drive) using accessible parts, then this package is for you. This reposit

linorobot 195 Dec 29, 2022
This is a simple Tic Tac Toe game built with Python.

This is a simple Tic Tac Toe game built with Python.

⚝αикιт кυмαя⚝ 6 Sep 01, 2022
This is a two player snake game

Trake This is a two player snake game How to play the game There is food and two players. You try to eat food to become large and gain points. Player

Grrub 1 Dec 19, 2021
A short non 100% Accurate Solar System in pygame

solar-system-pygame Controls UP/DOWN for Emulation Speed Control ESC for Pause/Unpause q to Quit c or ESC again to Continue LEFT CLICK to Add an orbit

LightCrimson 2 May 28, 2022