I work with a Russian guy turned American Citizen. His family (mother,
brother,etc) still live in Moscow. With the help of instant messaging and skype,
he keeps in touch with them daily. His little brother is in his 11th year of
school and taking a programming elective. Their language of choice is Ruby :)
I've been helping him with his homework. Yesterday, the problem was to accept a
number from the user, split it up by digit and multiply each digit by the
previous sum.
Just for grins I gave it to him on one line :)
x=1;gets.chomp.each_char {|c| x = x * c.to_i|;puts x
I wonder what the teacher would say if he turned that in? :)