2011-05-21から1日間の記事一覧
「常識を覆すソートアルゴリズム!その名も"sleep sort"! - Islands in the byte stream」があまりにも面白いので,Rubyで作ってみました。 sleepsort.rb #!/usr/bin/env ruby def f(n) Thread.new(n) do |s| sleep (n.to_f / 10.0) puts n end end ARGV.ea…
「常識を覆すソートアルゴリズム!その名も"sleep sort"! - Islands in the byte stream」があまりにも面白いので,Rubyで作ってみました。 sleepsort.rb #!/usr/bin/env ruby def f(n) Thread.new(n) do |s| sleep (n.to_f / 10.0) puts n end end ARGV.ea…