Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Use K/k for king and N/n for knight. #5

Open
yixiang opened this issue Apr 7, 2018 · 6 comments
Open

[Feature Request] Use K/k for king and N/n for knight. #5

yixiang opened this issue Apr 7, 2018 · 6 comments

Comments

@yixiang
Copy link
Contributor

yixiang commented Apr 7, 2018

A common ASCII representation king and knight are K and N, not G and K.

@flyingtrapeze-zz
Copy link

flyingtrapeze-zz commented Apr 8, 2018

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"
            }

@yixiang
Copy link
Contributor Author

yixiang commented Apr 9, 2018

printBoardState() is fixed in #4.

@SteveBarnegren
Copy link
Owner

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.

@flyingtrapeze-zz
Copy link

flyingtrapeze-zz commented Apr 11, 2018 via email

@chessboy
Copy link

chessboy commented Dec 22, 2020

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!

@chessboy
Copy link

chessboy commented Dec 22, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants