# Chess engine in ruby?

**URL:** <https://www.ruby-forum.com/t/chess-engine-in-ruby/55009>\
**Category:** Ruby\
**Created:** [March 16, 2006, 5:41am UTC](https://www.ruby-forum.com/t/chess-engine-in-ruby/55009 "2006-03-16T05:41:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [March 16, 2006, 5:41am UTC](https://www.ruby-forum.com/t/chess-engine-in-ruby/55009/1 "2006-03-16T05:41:40Z")

</div>

I’m a beginning chess player and a beginning Ruby developer 🙂 I was  
wondering if there’s a Ruby chess engine somewhere.

I thought it might be interested to read the code and see if I get  
better at Ruby, or chess, or both.

I’m also interested to see if the Ruby code is more understandable - in  
the past I tried to understand C and Java engines without much luck.

If you’ve heard of some kind of chess engine written in Ruby, could you  
let me know?

Thanks!  
Jeff

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [March 16, 2006, 7:15am UTC](https://www.ruby-forum.com/t/chess-engine-in-ruby/55009/2 "2006-03-16T07:15:41Z")

</div>

Jeff C. wrote:

> let me know?  
> I don’t know of one, but the idea is interesting.

It might not be practical because of speed. Most chess algorithms  
are very search-intensive.

Now, one thing I’ve thought about but will never have the time to  
implement – make it a distributed application (with drb) so that  
the work can be split among different machines.

Now _that_ would be interesting. And if you throw enough boxes  
at it, you eliminate the speed issue. You could in theory produce  
a distributed chess app in Ruby that was “as fast” as a non-  
distributed one in C.

Just a thought.

Cheers,  
Hal

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [March 16, 2006, 7:18am UTC](https://www.ruby-forum.com/t/chess-engine-in-ruby/55009/3 "2006-03-16T07:18:44Z")

</div>

Hey Jeff,

There have been two rubyquizzes (is that really the plural?) on that:  
[http://rubyquiz.com/quiz35.html](http://rubyquiz.com/quiz35.html)  
[http://rubyquiz.com/quiz36.html](http://rubyquiz.com/quiz36.html)

You should also check RAA and rubyforge for that.  
[http://raa.ruby-lang.org/search.rhtml?search=chess](http://raa.ruby-lang.org/search.rhtml?search=chess)  
[http://rubyforge.org/search/?type\_of\_search=soft&words=chess&Search=Search](http://rubyforge.org/search/?type_of_search=soft&words=chess&Search=Search)

Hope that helps you a bit 🙂

```plaintext

```

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [March 16, 2006, 3:44pm UTC](https://www.ruby-forum.com/t/chess-engine-in-ruby/55009/4 "2006-03-16T15:44:26Z")

</div>

calculations per second(speed) is a major factor in creating a powerful  
chess program.

however, scripting languages are not excluded from creating something  
that works.

if python can do it, why can’t ruby?

python:  
[http://www.kolumbus.fi/jyrki.alakuijala/pychess.html](http://www.kolumbus.fi/jyrki.alakuijala/pychess.html)

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [March 16, 2006, 5:51pm UTC](https://www.ruby-forum.com/t/chess-engine-in-ruby/55009/5 "2006-03-16T17:51:43Z")

</div>

Michael F. wrote:

> Hey Jeff,
> 
> There have been two rubyquizzes (is that really the plural?) on that:  
> [Ruby Quiz - Chess Variants (I) (#35)](http://rubyquiz.com/quiz35.html)  
> [Ruby Quiz - Chess Variants (II) (#36)](http://rubyquiz.com/quiz36.html)
> 
> You should also check RAA and rubyforge for that.  
> [http://raa.ruby-lang.org/search.rhtml?search=chess](http://raa.ruby-lang.org/search.rhtml?search=chess)  
> [http://rubyforge.org/search/?type\_of\_search=soft&words=chess&Search=Search](http://rubyforge.org/search/?type_of_search=soft&words=chess&Search=Search)
> 
> Hope that helps you a bit 🙂
> 
> ```plaintext
> 
> ```

Hi Michael,

Thanks for the links. Unfortunately the ruby quizzes were for  
two-player chess, but I’m hoping to find some code that would let me  
play against the computer. Being new to chess I’m not looking for Deep  
Blue quality, just something that works reasonably well (maybe up to a  
900 chess rating, not 2500).

Uh oh… I’m getting the feeling as I write this that I might have  
ventured into the waters of “he who suggested it should do it.” 🙂

It would also be a good way to compare the speed of 1.8.2 vs. 2.0  
(whenever 2.0 comes out).

Jeff

> **[Hey Daddio!](http://www.softiesonrails.com)**
>
> Home of Hey Daddio Software

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [March 16, 2006, 6:21pm UTC](https://www.ruby-forum.com/t/chess-engine-in-ruby/55009/6 "2006-03-16T18:21:52Z")

</div>

On Mar 16, 2006, at 10:52 AM, Jeff C. wrote:

> Uh oh… I’m getting the feeling as I write this that I might have  
> ventured into the waters of “he who suggested it should do it.” 🙂

I for one would be very interested to see what you could come up with.

James Edward G. II
