Chessnut | simple chess board model | Game Engine library

 by   cgearhart Python Version: 0.3.1 License: Unlicense

kandi X-RAY | Chessnut Summary

kandi X-RAY | Chessnut Summary

Chessnut is a Python library typically used in Gaming, Game Engine applications. Chessnut has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install Chessnut' or download it from GitHub, PyPI.

Chessnut is a simple chess board model written in Python. Chessnut is not a chess engine -- it has no AI to play games, and it has no GUI. It is a simple package that can import/export games in Forsyth-Edwards Notation (FEN), generate a list of legal moves for the current board position, intelligently validate & apply moves (including en passant, castling, etc.), and keep track of the game with a history of both moves and corresponding FEN representation. Chessnut is not written for speed, it is written for simplicity (there are only two real classes, and only about 200 lines of code). By adding a custom move evaluation function, Chessnut could be used as a chess engine. The simplicity of the model lends itself well to studying the construction of a chess engine without worrying about implementing a chess model, or to easily find the set of legal moves for either player on a particular chess board for use in conjunction with another chess application.

            kandi-support Support

              Chessnut has a low active ecosystem.
              It has 36 star(s) with 15 fork(s). There are 4 watchers for this library.
              It had no major release in the last 12 months.
              There are 2 open issues and 9 have been closed. On average issues are closed in 20 days. There are 2 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of Chessnut is 0.3.1

            kandi-Quality Quality

              Chessnut has 0 bugs and 0 code smells.

            kandi-Security Security

              Chessnut has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              Chessnut code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              Chessnut is licensed under the Unlicense License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              Chessnut releases are not available. You will need to build from source code and install.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              Chessnut saves you 178 person hours of effort in developing the same functionality from scratch.
              It has 443 lines of code, 34 functions and 10 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed Chessnut and discovered the below as its top functions. This is intended to give you an instant insight into Chessnut implemented functionality, and help decide if they suit your requirements.
            • Return the game status
            • Apply a move
            • Return a list of moves for a piece
            • Return all moves in the game
            • Return a list of all possible moves for a piece
            • Set the position
            • Set the FEN history
            • Return the owner of a piece
            • Move piece from start to end
            • Resets the simulation
            • Find the piece of the given symbol
            • Convert an index to a 16 - bit integer
            • Convert from xy toi coordinates
            • Return the piece at the given position
            Get all kandi verified functions for this library.

            Chessnut Key Features

            No Key Features are available at this moment for Chessnut.

            Chessnut Examples and Code Snippets

            Chessnut,Using Chessnut
            Pythondot img1Lines of Code : 16dot img1License : Permissive (Unlicense)
            copy iconCopy
            from Chessnut import Game
            chessgame = Game()
            print(chessgame)  # 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1'
            ['a2a3', 'a2a4', 'b2b3', 'b2b4', 'c2c3', 'c2c4', 'd2d3', 'd2d4', 'e2e3', 
             'e2e4', 'f2f3',   
            Pythondot img2Lines of Code : 5dot img2License : Permissive (Unlicense)
            copy iconCopy
            ~$ mkdir ~/project
            ~/$ cd project
            ~/project$ virtualenv env
            ~/project$ source env/bin/activate
            Chessnut,Installation,As a Module
            Pythondot img3Lines of Code : 5dot img3License : Permissive (Unlicense)
            copy iconCopy
            from Chessnut import Game

            Community Discussions


            How can I manipulate this chess notation with python?
            Asked 2021-Nov-03 at 19:22

            I'm trying to use some chess related libraries in python (e.g. chessnut and chess) and they use the following notation

            r1bqkb1r/pppp1Qpp/2n2n2/4p3/2B1P3/8/PPPP1PPP/RNB1K1NR b KQkq - 0 4

            I've searched about it and didn't find anything. How can I manipulate this and how can I transform the standart algebraic notation (e.g. "d4 Nc6 e4 e5 f4 f6 dxe5 fxe5") into this new one?



            Answered 2021-Oct-31 at 13:29

            That notation is called FEN (Forsyth–Edwards Notation), and it looks like python-chess knows about it and can parse it.

            This notation is not really equivalent to a list of moves - this is for specifying a position, which might also be a starting position. There's no complete record of how the game reached that point.

            Python-chess can turn any board position you've loaded into it - for example using PGN notation - into this notation though.


            Community Discussions, Code Snippets contain sources that include Stack Exchange Network


            No vulnerabilities reported

            Install Chessnut

            You can install using 'pip install Chessnut' or download it from GitHub, PyPI.
            You can use Chessnut like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.


            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
          • PyPI

            pip install Chessnut

          • CLONE
          • HTTPS


          • CLI

            gh repo clone cgearhart/Chessnut

          • sshUrl


          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Game Engine Libraries


            by godotengine


            by photonstorm


            by libgdx


            by aseprite


            by BabylonJS

            Try Top Libraries by cgearhart


            by cgearhartJava


            by cgearhartPython


            by cgearhartPython


            by cgearhartJupyter Notebook


            by cgearhartPython