Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
15-liner: The City Has Been Built Made Carefully solution in Clear category for Building Base by Stensen
from dataclasses import dataclass
@dataclass
class Building:
south: int
west: int
width_WE: int
width_NS: int
height: int = 10
corners = lambda self: {"north-west": [self.south + self.width_NS, self.west],
"north-east": [self.south + self.width_NS, self.west + self.width_WE],
"south-west": [self.south, self.west],
"south-east": [self.south, self.west + self.width_WE]}
area = lambda self: self.width_WE * self.width_NS
volume = lambda self: self.width_WE * self.width_NS * self.height
__repr__ = lambda self: f"Building({self.south}, {self.west}, {self.width_WE}, {self.width_NS}, {self.height})"
Oct. 14, 2020
Comments: