Comments on: DWITE 2006 – now with Ruby http://compsci.ca/blog/dwite-2006-now-with-ruby/ Programming, Education, Computer Science Wed, 30 Sep 2020 08:31:44 -0400 http://wordpress.org/?v=2.8.4 hourly 1 By: wtd http://compsci.ca/blog/dwite-2006-now-with-ruby/comment-page-1/#comment-28 wtd Fri, 03 Nov 2006 18:46:49 +0000 http://compsci.ca/blog/dwite-2006-now-with-ruby/#comment-28 Your solution can be made much cleaner: File.new("OUT11.txt", "w") do |out| IO.foreach("DATA11.txt") do |line| out.printf "%0.2f\n", num.to_f ** 2 end end Your solution can be made much cleaner:

File.new(”OUT11.txt”, “w”) do |out|
IO.foreach(”DATA11.txt”) do |line|
out.printf “%0.2f\n”, num.to_f ** 2
end
end

]]>