Created
September 10, 2012 11:54
-
-
Save morganp/3690522 to your computer and use it in GitHub Desktop.
Calculate rom sixes and House size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def sqm_to_sqft(num) | |
num*10.763910 | |
end | |
# http://www.espc.com/properties/details.aspx?pid=315620&sid=25446441807 | |
data = [ | |
[3.75, 3.32], | |
[2.95, 2.87], | |
[3.78, 2.47], | |
[1.88, 1.45], | |
[2.13, 1.88], | |
[3.68, 3.14], | |
[1.55, 1.46], | |
[3.27, 2.59], | |
[2.66, 2.59], | |
[2.87, 2.03], | |
[2.16, 1.98], | |
[1.88, 0.93]] | |
room_sizes = data.collect{ |room| room.reduce(:*) } | |
house_size = room_sizes.reduce(:+) | |
puts house_size.to_s + " m^2" | |
puts sqm_to_sqft( house_size ).to_s + " \"^2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the_grahame = [
[3.11, 2.8],
[1.8,2.8],
[3.16, 5.3],
[3.16,2.81],
[2.50,1.14],
[2.5,1.8],
[2.5,2.19],
[3.74,3.34],
[4.32,2.84],
[2.6,3.48],
[3.18,2.89],
[2.25,2.34],
[2.09,1.81],
[2.60,1.73]]