Git Product home page Git Product logo

Comments (6)

flyingtrapeze-zz avatar flyingtrapeze-zz commented on May 27, 2024

the function printBoardState() requires some attention too

           switch piece.type {
            case .rook:
                character = piece.color == .white ? "R" : "r"
            case .knight:
                character = piece.color == .white ? "K" : "k"
            case .bishop:
                character = piece.color == .white ? "B" : "b"
            case .queen:
                character = piece.color == .white ? "Q" : "q"
            case .king:
                character = piece.color == .white ? "K" : "k"
            case .pawn:
                character = piece.color == .white ? "P" : "p"
            }

from swiftchess.

yixiang avatar yixiang commented on May 27, 2024

printBoardState() is fixed in #4.

from swiftchess.

SteveBarnegren avatar SteveBarnegren commented on May 27, 2024

I've merged the fix for printBoardState()

Switching to K and N rather than G and K would definitely be clearer, and more in line with other representations. The main hurdle is that most of the tests define board states using ascii board representations, so they would all need to be changed to the new system, which would take a little bit of time. (an hour or so maybe)

If anyone wants to pick this up and make the change I'll be happy to merge it in. Otherwise I'll do it next time I make some updates to my chess game, but I can't guarantee when that will be.

from swiftchess.

flyingtrapeze-zz avatar flyingtrapeze-zz commented on May 27, 2024

from swiftchess.

chessboy avatar chessboy commented on May 27, 2024

I'm starting to use this library, and agree standard Algebraic chess notation would really help this library. It will also help if PGN support is added later, e.g. let game = Game(pngText: String) and let pgnText = game.pgnText.

I will try to do the refactor and make a PR for you to review. Thanks!

from swiftchess.

chessboy avatar chessboy commented on May 27, 2024

If anyone wants to pick this up and make the change I'll be happy to merge it in. Otherwise I'll do it next time I make some updates to my chess game, but I can't guarantee when that will be.

Done. PR is here, @SteveBarnegren

from swiftchess.

Related Issues (17)

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.