box-o-sand/round0/rice.rb

7 lines
143 B
Ruby
Raw Normal View History

2009-06-12 01:56:55 +00:00
rice_on_square = 1
64.times do |square|
puts "On square #{square + 1} are #{rice_on_square} grain(s)"
rice_on_square *= 2
end