Programming Perls Rewritten in Ruby

Just for a little exercise i am doing the programming pearls examples/tasks in ruby, and so far it has been funny/challenging.
Source is on github

Trivial examples

#displaying all words from STDIN
int main(void)
{   set S;
    set::iterator j;
    string t;
    while (cin >> t)
    for (j = S.begin(); j != S.end(); ++j)
        cout << *j << "\n";
    return 0;

puts STDIN.readlines(' ').uniq * "\n"

ruby is my winner 😀

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s