--0016e65b603677596e04886ba8cf
Content-Type: text/plain; charset=ISO-8859-1

On Sun, Jun 6, 2010 at 11:48 PM, Lakshmanan Muthukrishnan <
lakshmanan / vinsol.com> wrote:

> Hi,
>
> I am reading ruby from the book "Programming ruby" and that book lacks
> programming exercises. I want to work out some problems in ruby.
>
> Please point me towards a good resource on the net or it can be a book
> also.
>
> thanks
> --
> Posted via http://www.ruby-forum.com/.
>
>
Codingbat.com has lots of simple easy problems, but it's mostly Java and a
little bit of Python. Still, you can solve the problem however you like, you
just won't be able to use their automatic tester.

There are also a bunch at spoj.pl but I found that site frustrating, because
it's too dependent on string format of your output (a stray newline will
invalidate your solution, but you aren't given enough feedback to figure out
what formatting needs to change) And their time constraints are aimed at
compiled languages, which frequently prevents Ruby from being a possibility.

codechef.com is basically spoj.pl taken to the next level with a community
and flashy design. But I have had a lot of trouble getting their Ruby to
work right for me, and they don't keep track of which solutions you've
previously solved, so you can't really make a goal of solving all the
problems they have. I'll probably try it again in 6 months or so, see if
they've made that stuff better.

If you like math, projecteuler.net is a good choice, math problems whose
scope is large enough that they usually require writing a program in order
to solve them. Hardcore number crunching isn't a great domain for Ruby,
though, and the problems get quite advanced pretty quickly. I maxed out at
140 solved. But the problem solving skills of math complement the problem
solving skills of programming (imo, anyway). I found it very helpful for
developing problem solving skills, and figuring out how to transform what I
have into what I want.

I'm teaching some friends Ruby, and took a bunch of problems from a lot of
different places, they have automated tests that you can run locally, and
solutions also. If you're interested, let me know, and I can put up
installation instructions, so that you can try your hand at it. (you'll need
to have git installed to get updates, or copy and paste a lot of files, I'm
sort of building it as we go, there are 30 problems at present)
Some examples of the challenges
http://github.com/JoshCheek/JoshsRubyKickstart/blob/master/ch2/challenge/1_input_output.rb
http://github.com/JoshCheek/JoshsRubyKickstart/blob/master/ch2/challenge/12_classes.rb
http://github.com/JoshCheek/JoshsRubyKickstart/blob/master/ch3/challenge/3_hashes.rb
There are also solutions included (though many do not have a single correct
answer, and I try to keep the solutions within the scope of what we have
covered together).

--0016e65b603677596e04886ba8cf--