Find the last Sunday in every month of a given year
Ruby, 91+6=97

#!ruby -prdate
$_=(Date.new(y=$_.to_i)...Date.new(y+1)).select(&amp;:sunday?).chunk(&amp;:mon).map{|k,v|v[-1]}*' '


Works out pretty well. select(&amp;:sunday?) is pretty, and surprisingly, *' ' does all of the formatting by itself.