Comments (6)
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.
printBoardState() is fixed in #4.
from swiftchess.
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.
from swiftchess.
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.
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)
- Images for readme
- How can I implement undo function? HOT 2
- Levels HOT 2
- Multi player HOT 1
- Timer HOT 2
- App is crashing when I navigate back to MenuViewController. HOT 1
- [Request] Add Castling HOT 1
- undo options HOT 3
- PGN Parser HOT 1
- Some time moves not working. HOT 1
- Reset Game HOT 1
- add legal moves? HOT 2
- How strong the engine is? HOT 1
- Locking mechanism for resources
- Can you build a Korean chess engine?
- The code doesn't work. Please see the log below. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swiftchess.