question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :sunlight_on_its_way do 4 kind :numerical 5 describes "Suppose the unit of length were the distance light goes in one second. Sunlight takes 8 minutes 20 seconds to reach us. %{distance}?" 6 asks distance: "How far is the Sun in that unit" 7 end
1 require_relative "../questions/sunlight_on_its_way" 2 require_relative "../science/units_and_measurement/units" 3 4 solve :sunlight_on_its_way , using: Units do 5 deduce_from "the distance light goes in one second" , c: 1.0 6 deduce_from "8 minutes 20 seconds" , t_light: "500 s" 7 take distance: :d_light 8 answer find_value ( :distance , figures: 3 ) 9 10 conclusion "Choose light's own travel as the unit of length and its speed becomes one, so a " \ 11 "distance and its travel time are the same number." 12 end
1 require_relative "../solutions/sunlight_on_its_way" 2 3 play_with :sunlight_on_its_way do 4 title "Sunlight on Its Way" 5 end