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)
ReplitTD - Replit Tower Defense Game

IMPORTANT: I mean no offense at all in this game, this is only based off of cycl

kokomi simp :3 3 Jun 25, 2022
AI Games and its programming solution with Python.

Problem: Save the princess: Problem defination on Hackerrank: https://www.hackerrank.com/challenges/saveprincess About problem: Princess Peach is trap

Hasit Parmar 1 Feb 19, 2022
A pygame implementation of John Conway's Game of Life

Game of Life A Pygame Simulation This is a Pygame implementation of the famous Conway's Game of Life. The game features a set of very simple rules: An

1 Jan 06, 2022
Typing test and practice on command line without the need of any internet connection

Terminal-Typing-Test Typing test and practice on command line without the need of any internet connection About CLI based typing test and practice tha

Angad Deep Singh 3 Oct 19, 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.

0 Feb 11, 2022
The Classic Fruit Collecting game made in python with pygame

FruitCollect A classic fruit Collecting game made with pygame Install pygame before running: "pip install pygame" Rules: Random fruits will drop from

Pranav Bobby 1 Dec 01, 2021
A Frogger game in Python with pygame

CrockiCrocki A personal project of a simple "game" in Python to learn Pygame and Python. Requires: pygame: In Linux: pip3 install pygame In MacOS: pip

Jorge Abreu 1 Nov 07, 2021
python script to convert .OBJ files into Minecraft, rendering them in game with a core shader.

samples: random notes about the tool general output format: (animation not supported yet but planned) vertex id Minecraft's gl_VertexID isn't per mode

199 Jan 02, 2023
Useful guides, tutorials, and FAQs related to LEGO Universe and Darkflame Universe.

Awesome Lego Universe A curated list of awesome things related to LEGO Universe. LEGO Universe was a kid-friendly massively-multiplayer online role pl

Eric Myllyoja 33 Dec 12, 2022
Create a Hangman Game using Python and all techniques of Python.

Hangman Game Created by Fernando Callasaca Game rules: Choose a word and if you guess it will appear completed. In case it is not the word then the ma

Fernando Callasaca 3 Nov 01, 2021
Official PyTorch implementation of NAC from the paper: Neural Auto-Curricula in Two-Player Zero-Sum Games.

NAC Official PyTorch implementation of NAC from the paper: Neural Auto-Curricula in Two-Player Zero-Sum Games. We release code for: Gradient based ora

Xidong Feng 19 Nov 11, 2022
I automated the lumberjack game on telegram, by recognising pixels and using pyautogui module

Lumberjack Automated: @gamebot According to the official documentation, @gamebot is a demo bot for the Telegram Gaming Platform.` It provides some sam

Yew Chong 1 Dec 07, 2021
A project to san the internet of all open Minecraft servers.

MC-Server-Finder A project that scans the internet to find open Minecraft servers. Install the dependencies by running pip install -r requirements.txt

drakeerv 8 Mar 12, 2022
Wordle is a word game reminiscent of mastermind

Wordle is a word game reminiscent of mastermind. The player tries to guess a five letter word within six attempts. After each attempt, hints are given. Green tiles show that the letter is in the righ

Sidharth Anand 1 Feb 09, 2022
I got bored and wrote a wordle solver... Its pretty good though, just saying

Wordle Solver I got bored and wrote a wordle solver... Its pretty good though, just saying. Please go support Josh and have fun with Wordle on the off

Darrell Best 2 Jan 25, 2022
Rock Paper Scissors Game with PyQt5

Rock-Paper-Scissors-Game rock paper scissors is a old game that all of us played it but this time let's play with computer Description This is Rock Pa

MohammadAli.HBA 4 Nov 11, 2021
This is a simple tic tac toe game that runs in the command line.

Tic Tac Toe Game This is a simple tic tac toe game that runs in the command line. Game Description: The game is made up of a square grid with 9 portio

Josias Aurel 2 Nov 12, 2022
Simple car game written in PyGame

Welcome to CarGame 👋 Car Game written in PyGame! NOTE: This is still new and there may be stuff broken... 🏠 Homepage Install install pygame by typin

John 1 Oct 29, 2021
A Replit Game Know As ROCK PAPER SCISSOR AND ALSO KNOW AS STONE PAPER SCISSOR

🔥 ᴿᴼᶜᴷ ᴾᴬᴾᴱᴿ ᔆᶜᴵᔆᔆᴼᴿ 🔥 ⚙️ Rᴜɴ Oɴ Rᴇᴘʟɪᴛ 🛠️ Lᴀɴɢᴜᴀɢᴇs Aɴᴅ Tᴏᴏʟs If you are taking code from this repository without a fork, then atleast give credit

ANKIT KUMAR 1 Dec 25, 2021
Easy and fun game to play a bit. Written in python

NumGuesser Easy and fun game to play a bit. Written in python

Lodi#0001 4 May 22, 2022