My first Ruby program ever was to write a function to determine if a triangle given the size of its size, was scalene, isosceles or equilateral.
I wrote if statements to see if the sides were equals, but ruby can do it even neater:
when 1 then :equilateral
when 2 then :isosceles
Took a bit of self control to not use ‘;’ to end statements!