Well, I'm trying to learn ruby (again!). I've played with it last year during a course provided by Coursera and the University of California, Berkeley, but in the end, I just did some stuff with the rails framework and my knowledge about the language itself was practically none. I also tried codecademy but as I didn't practice more after solving the exercises, I forgot a lot of stuff. So I decided to really learn it by doing some programming exercises from previous Google Code Jam contests. I think that's the best way to learn a new language and really dig in its details. The first code it's always a little bit "weird", but with some practice and some reading about "best practices", in just a few weeks, I hope to write some pretty lines of code, just like I do in other languages.
I started with this problem called "Tic-Tac-Toe-Tomek" and I solved it in about 2 hours of coding. Most of the time I spent searching for some sample code in stackoverflow, but learnXinYminutes was also a good resource.
Here's the code I made for solving the problem:
As you can see, there's a lot to improve, and I'm perfectly aware that this is not the best solution. I can, and I will do better, but with two hours spent, I think it's not that bad.
A point to note when solving this problem: ruby doesn't support "pass by reference" at all. As you can see in the previous link, you can accomplish this by explicitly passing in the current binding, and I did so in the "checkLine" method. So basically, ruby passes by value, do not forget.