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? :)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know
on the House of Fusion mailing lists
Archive:
http://www.houseoffusion.com/groups/cf-community/message.cfm/messageid:313569
Subscription: http://www.houseoffusion.com/groups/cf-community/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-community/unsubscribe.cfm