https://github.com/pioz/chess
A fast chess library that use bitboards to play chess with Ruby
https://github.com/pioz/chess
bitboards chess fast ruby
Last synced: 4 months ago
JSON representation
A fast chess library that use bitboards to play chess with Ruby
- Host: GitHub
- URL: https://github.com/pioz/chess
- Owner: pioz
- License: lgpl-3.0
- Created: 2012-09-17T13:54:31.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T18:50:11.000Z (over 1 year ago)
- Last Synced: 2025-04-12T23:38:41.165Z (10 months ago)
- Topics: bitboards, chess, fast, ruby
- Language: C
- Homepage:
- Size: 1.71 MB
- Stars: 59
- Watchers: 6
- Forks: 17
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Chess

[](https://codecov.io/gh/pioz/chess)
A fast Ruby gem to play chess with Ruby. This library is quite fast because manage game situations with [bitboards](https://en.wikipedia.org/wiki/Bitboard). Also, the move generator is written in C as a Ruby extension.
## Requirements
- Ruby 2.5 or higher
## Installation
gem install chess
## Usage
```ruby
require 'chess'
g = Chess::Game.new
until g.over?
begin
print "Give me a #{g.active_player} move: "
input = gets.chop
break if input == 'quit'
g << input
puts g
puts g.moves.last
rescue Chess::IllegalMoveError => e
puts 'Illegal move!'
end
end
puts g.status
```
📚 **Documentation** is available [here](https://pioz.github.io/chess).
## Questions or problems?
If you have any issues please add an [issue on
GitHub](https://github.com/pioz/chess/issues) or fork the project and send a
pull request.
## Copyright
Copyright (c) 2024 [Enrico Pilotto (@pioz)](https://github.com/pioz). See
[LICENSE](https://github.com/pioz/chess/blob/master/LICENSE) for details.