Skip to content

Instantly share code, notes, and snippets.

@johnhaitas
Created December 5, 2011 17:27
Show Gist options
  • Save johnhaitas/1434470 to your computer and use it in GitHub Desktop.
Save johnhaitas/1434470 to your computer and use it in GitHub Desktop.
"Saving Time" solution in Ruby
a='o'*12
a[gets.to_i%12]=?h
a[m=$_[3,2].to_i/5]=a[m]<?o??x:?m
b=Array.new(11){" "*17}
12.times{|i|t=i*0.523-1.57;b[(5+4.9*Math.sin(t)).round][(8+8*Math.cos(t)).round]=a[i]}
b.map{|l|puts l.rstrip}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment