On 4/25/07, Andrei Ursan <steelheart222 / gmail.com> wrote:
>
> Strings value are read from the keyboard, and i need a getch and clrscr
> method.
> And how can I export the ruby code into *.exe ?
>
> Can somebody translate this into ruby ? I need it fast...
>

Have you gotten a suitable answer yet?

There are several options for you here.
1) Transliterate into Ruby (as you imply)
2) Leave your code as-is and wrapper it using Ruby's C api
3) Leave your code as-is and use the Ruby DL module to load your
library and invoke the methods
4) Use the RubyInline module to simply "inline" your C/C++ code into a
Ruby program

By far the quickest solution is going to be the RubyInline route.
You'll need a compiler installed on your machine to handle the C++
code compilation step RubyInline performs. You can install RubyInline
via the gem command:

gem install -r rubyinline

Shoot a nice note of thanks off to Eric Hodel and Ryan Davis. They've
done a great job with that little gem.

Have fun learning Ruby! I've learned far more about programming by
using Ruby than I ever learned using C/C++ or Java.

Blessings,
TwP