question.rb
solution.rb
playground.rb
1 require_relative "../physics" 2 3 question :a_calorie_elsewhere do 4 kind :scq 5 describes "A calorie is %{calorie}. In a system whose units of mass, length and time are α kg, β m and γ " \ 6 "s, how many of the new units of energy is a calorie?" 7 given calorie: "4.2 J" 8 9 option "4.2 α⁻¹ β⁻² γ²" , as: :inverse 10 option "4.2 α β² γ⁻²" , as: :direct 11 option "4.2 α⁻¹ β⁻¹ γ" , as: :half_inverse 12 option "4.2 α β γ" , as: :plain 13 end
1 require_relative "../questions/a_calorie_elsewhere" 2 require_relative "../science/units_and_measurement/dimensions" 3 4 solve :a_calorie_elsewhere , using: Dimensions do 5 take calorie: :W 6 take inverse: "4.2 α-1 β-2 γ2" , direct: "4.2 α β2 γ-2" , half_inverse: "4.2 α-1 β-1 γ" , plain: "4.2 α β γ" 7 answer find_value ( :W , in: { M : "α kg" , L : "β m" , T : "γ s" }) 8 9 conclusion "A unit changes as its dimensions say. Energy carries mass once, length twice and " \ 10 "time to the minus two, so the new unit of energy is that mixture of the new base " \ 11 "units, and a calorie is its old number divided by it." 12 end
1 require_relative "../solutions/a_calorie_elsewhere" 2 3 play_with :a_calorie_elsewhere do 4 title "A Calorie Elsewhere" 5 end