Giter Club home page Giter Club logo

chess's People

Contributors

alexanderklarge avatar janderion47 avatar levi-lesches avatar webdotorg avatar zeroone010101 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

chess's Issues

the indexes are reverse of what they are supposed to be

the rows only, the columns are fine. youll likely see it if you run it and move a few pieces.
its either the array itself or the draw function.
if its the array, we need to change the inputparser and draw function, or the array itself

Board is transposed on Black's turn, not mirrored like it should be

Basically, your pieces are always shown at the bottom. So moving, say, a2 --> a3 should be valid when your pieces are actually at a2, but not when they're simply printed that way.

So what should we do? Keep the display of the board the same, no matter who's turn it is? Or have a function to translate a2 to g7 if needed?

Make chessboard setup more efficient

Right now each square is initialized to an empty piece in Board.__init__. Then, in Board.setup, each square is looped over and potentially replaced with another piece.

We can probably do that all in one go, and halve the work we need to do for setup. I'm thinking about moving the "which piece goes on this square?" logic to Square.__init__, which already has access to its row & column

Add module specific logging.

The current logging logs everything to the root logger, but it seems to be customary for each module to have its own logger and for root to control them but not be used.
I tried my hand at it a bit already, see the commented code at the start of main and board.

`Board.move` moves the other player

This should speak for itself:

>> chess
  |
8 |  ♜    ♞    ♝    ♛    ♚    ♝    ♞    ♜
  |
7 |  ♟    ♟    ♟    ♟    ♟    ♟    ♟    ♟
  |
6 |  ☐    ☐    ☐    ☐    ☐    ☐    ☐    ☐
  |
5 |  ☐    ☐    ☐    ☐    ☐    ☐    ☐    ☐
  |
4 |  ☐    ☐    ☐    ☐    ☐    ☐    ☐    ☐
  |
3 |  ☐    ☐    ☐    ☐    ☐    ☐    ☐    ☐
  |
2 |  ♙    ♙    ♙    ♙    ♙    ♙    ♙    ♙
  |
1 |  ♖    ♘    ♗    ♕    ♔    ♗    ♘    ♖
--+-------------------------------------------
  |  a    b    c    d    e    f    g    h

white: a2 a3

  |
1 |  ♖    ♘    ♗    ♔    ♕    ♗    ♘    ♖
  |
2 |  ♙    ♙    ♙    ♙    ♙    ♙    ♙    ♙
  |
3 |  ☐    ☐    ☐    ☐    ☐    ☐    ☐    ☐
  |
4 |  ☐    ☐    ☐    ☐    ☐    ☐    ☐    ☐
  |
5 |  ☐    ☐    ☐    ☐    ☐    ☐    ☐    ☐
  |
6 |  ☐    ☐    ☐    ☐    ☐    ☐    ☐    ♟
  |
7 |  ♟    ♟    ♟    ♟    ♟    ♟    ♟    ☐
  |
8 |  ♜    ♞    ♝    ♚    ♛    ♝    ♞    ♜
--+-------------------------------------------
  |  a    b    c    d    e    f    g    h

Black starts his turn with his pieces moved. This is caused by a2 a3 being translated internally to ( (1, 0), (2, 0) ), which is at the top of the board from White's point of view. This needs to dynamically change.

Move main() to seperate File

I think it might be good to move main() to a seperate file to segment the project. Then put stage 2 in another file and so on, and the main file ties our files together.

White is black a.k.a. mirror vs transpose error.

error in question:
|
8 | ♜ ♞ ♝ ♛ ♚ ♝ ♞ ♜
|
7 | ♟ ♟ ♟ ♟ ♟ ♟ ♟ ♟
|
6 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
5 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
4 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
3 | ☐ ☐ ☐ ☐ ☐ ☐ ☐ ☐
|
2 | ♙ ♙ ♙ ♙ ♙ ♙ ♙ ♙
|
1 | ♖ ♘ ♗ ♕ ♔ ♗ ♘ ♖
--+-------------------------------------------
| a b c d e f g h

White: a7 a6
Move from (1, 0) to (2, 0)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.