Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Namedtuple solution in Creative category for Building Base by nicuveo
from collections import namedtuple
NW, NE, SW, SE = "north-west", "north-east", "south-west", "south-east"
Building = namedtuple("Building", "y x w h s")
Building.__new__.__defaults__ = (10,)
Building.__repr__ = lambda s: "Building({0}, {1}, {2}, {3}, {4})".format(*s)
Building.area = lambda s: s.w * s.h
Building.volume = lambda s: s.w * s.h * s.s
Building.corners = lambda s: {NW: (s.y+s.h, s.x ),
NE: (s.y+s.h, s.x+s.w),
SW: (s.y, s.x ),
SE: (s.y, s.x+s.w)}
Jan. 27, 2015
Comments: