chess
Version, currently main branch1 version
- main branchlatestNov 15, 2024
github.com/drujensen/chess
terminal chess written in crystal
Installation
# Add this to your shard.yml
dependencies:
chess:
github: drujensen/chess
branch: mainmain is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.30.0- License
- MIT
- Author
- Dru Jensen
- Target
chessfrom src/chess.cr
Dependencies
This version declares no dependencies.
README
Chess
Play a game of chess against ChatGPT 4 Turbo.
Written in the Crystal language.
This is a terminal app that allows you to play chess against the best player in the world. Lucky for you, you get to play white. ChatGPT will play black.
You may need to zoom in to see the board properly.
Installation
You will need an API Key from OpenAI to use this app.
export OPENAI_API_KEY=your-api-key
Then clone the repository:
git clone https://github.com/drujensen/chess.git
Install crystal language: MacOS:
brew install crystal
Linux:
curl -fsSL https://crystal-lang.org/install.sh | sudo bash
Build
There are no dependencies to install. Just build the app:
shards build
Usage
./bin/chess
To move, use long algebraic notation.
For example, to move the pawn: e2e4
To move the knight: g1f3
Development
List of things to contribute:
- [x] Draw chess board using unicode characters
- [x] Handle validation of basic chess moves
- [x] Support long algebraic notation
- [x] Handle castling
- [x] Handle en passant
- [x] Handle pawn promotion - queen only
- [ ] Handle check
- [ ] Handle checkmate
- [ ] Handle stalemate
- [ ] Handle draw
- [ ] Add time controls?
Contributing
- Fork it (https://github.com/drujensen/chess/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- Dru Jensen - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
main- Seen
- Nov 15, 2024
- Crystal
0.30.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/drujensen/chess
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 17, 2026
- Synced
- Aug 17, 2026
- Versions
- 1