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)
Tic-Tac-Toe - Tic-Tac-Toe game build With Python

Tic Tac Toe This game is very popular amongst all of us and even fun to build as

PyLaboratory 0 Feb 06, 2022
Mandaw 2 Mar 01, 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
A Higher-Lower web game made in Python using Flask framework.

Higher Lower Web Game Guess the random number from 0 to 9 in this web game made with Python and Flask Framework Modules that were used Random Flask In

Yago Goltara 1 Oct 27, 2021
Tic Tac Toe game developed in python; have 2 difficulty levels

Tic Tac Toe Game This is a code for Tic Tac Toe game in python. Game has 2 difficulty levels. Easy Hard To play the game, use this command in a LINUX

Akshat Mittal 1 Jun 25, 2022
AI Mario challenges you to clear all stage of Super Mario game.

mario-ai-challenge Challenge AI Mario to clear all stages of Super Mario. GitHub Pages Site Rules Enjoy building AI Mario. Share information. Use Goog

karaage 48 Dec 10, 2022
A game developed while learning python

Alien_Invasion a game developed while learning python you must have python-3 installed in your computer. and pygame module is also required for this.

Jani Shubham 0 Oct 10, 2022
A networking library for multiplayer games.

Aerics A networking library for multiplayer games. Getting Started Install Python Open cmd/terminal and type: pip install Aerics Examples Creating a

Yusuf Rençber 3 Jan 04, 2023
A simple python script to pregenerate minecraft worlds.

mcloady mcloady is a lightweight python script used to pre-generate Minecraft terrain using MCRcon and carpet mod (optional). Inspired by Pre-Generati

5 Dec 08, 2021
A simple hangman game for beginners trying to learn python

Hangman Game This is a simple hangman game for beginners trying to learn python. I have tried to keep it as simply as possible. Sample output Here is

1 Oct 13, 2021
Tekken-python-ml - A project of playing tekken game using python

Tekken Python Description Hi this is new project of playing tekken game using py

Programminghut 13 Dec 30, 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 game based on Motus, to be played on Unix terminals.

Motus python game A game based on Motus, to be played on Unix terminals. How to play? Before playing, you need to install all the requirements needed

Arthur Molia 1 Feb 02, 2022
Jogo Flappy Bird com phyton e phygame

Flappy-Bird Tecnologias usadas Requisitos para inicializar o jogo: Python faça o download em: https://www.python.org/ Pygame faça o download em: https

João Guilherme 1 Dec 06, 2021
Pyxel is a retro game engine for Python.

Pyxel is open source and free to use. Let's start making a retro game with Pyxel!

Takashi Kitao 11.2k Jan 09, 2023
Brawl Stars open source server for v20

Laser Scratch Brawl Stars open source server for v20! Implemented Features Battle End Leaderboard Player Profile Lobby Info Menu Notifications Club Wa

TheIke 17 Nov 19, 2022
Python codes for the classic Hang Man game

Python codes for the classic Hang Man game. The user will be assigned a random word to guess, one character at a time. If the user gets everything right, the program says Well Done!, but if the user

p.katekomol 1 Jan 25, 2022
Game Boy emulator written in Python

If you have any questions, or just want to chat, join us on Discord. It is highly recommended to read the report to get a light introduction to Game B

Mads Ynddal 3.7k Dec 30, 2022
Python module providing simple game networking

nethelper Python module providing simple game networking This module was originally created to facilitate a class on creating multiplayer games in Pyg

Cort 3 Jan 11, 2022
A python script to solve Wordle puzzles

Wordle solver A python script to solve Wordle puzzles.

Felix Weinberger 1 Feb 12, 2022