Skip to content

nbgoodall/ruby-chess

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A fast Ruby library to play chess with Ruby. This library is quite fast because rappresent the game situations with bitboards. In addition, the move generator is written in C as a Ruby extension.

  • Ruby 1.9 or higher

gem install ruby-chess
require 'chess'
g = RubyChess::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 RubyChess::IllegalMoveError => e
    puts 'Illegal move!'
  end
end
puts g.status

Documentation is available here.

If you have any issues please add an issue on GitHub or fork the project and send a pull request.

Copyright © 2015 Enrico Pilotto (@pioz). See LICENSE for details.

About

A fast chess library that use bitboards to play chess with Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 74.7%
  • Ruby 22.2%
  • C++ 3.1%