lorddarkula / chess_py Goto Github PK
View Code? Open in Web Editor NEWChess library for simple chess engine creation
Home Page: http://lorddarkula.github.io/chess_py/
License: MIT License
Chess library for simple chess engine creation
Home Page: http://lorddarkula.github.io/chess_py/
License: MIT License
When no move is provided and the enter key is hit instead, the program crashes.
Refactor code into variables, methods, and classes
class Converter:
def short_alg():
king_side = ....
..........
}
Extremely complicated set of imports in init.py. Decide if internal directories need to be packages.
These 3 should be the only publicly accessible methods
Renaming to_move to _to_move would probably be the easiest way to do this
get rid of constants outside the class (white and black), and replace with Color.White and Color.Black.
In order to work correctly with sphinx, docstrings must look like this . . .
def my(a, b):
"""
my does some shit
:type a: str
:type b: str
:rtype: str
"""
return a + b
Specifically test all string getters in this test class.
Replace for i in range(len(x))
with for i, j in enumerate(x)
When castling, the Location of the King somehow ends up as empty when testing checks in King.
test = copy.deepcopy(position)
# Somehow the Location of the King is empty
test_move = Move(end_loc=move.end_loc,
piece=test.piece_at_square(self.location), # Problem right here
status=move.status,
start_rank=self.location.rank,
start_file=self.location.file)
test.update(test_move)
test_king = test.piece_at_square(test_move.end_loc)
Certain methods that return a list of moves first generate a raw list then filter it. This is inefficient.
The tests directory should be populated with tests of all major methods.
Firstly, thanks for making this library available. I think all of the symbols associated to the chess pieces have the opposite color to the color intended. For instance on line 42 of the following file:
https://github.com/LordDarkula/chess_py/blob/master/chess_py/pieces/rook.py
we have
def _symbols(self):
return {color.white: "♜", color.black: "♖"}
which is surely not as intended? Or am I missing something?
Update README to reflect changes in v2.0, and point to the sphinx docs.
Add @property
to getters and @name.setter
to setters
def square(x: int) -> int:
return x*x
With the following goals
- more efficient
- reflect changes in the architecture
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.