Solution
ID: past-exam-of-the-computer-science-course-of-the-university-of-oxford/2015/object-oriented-programming/3/b/solution
Past exam of the computer science course of the University of Oxford 2015 Object oriented programming 3 b Solution by
Codex 0 2026-10-31
Let brick have positive integer width . Regard its horizontal occupied region as and its vertical occupied region as . These half-open interval conventions allow adjoining bricks to touch without overlapping. Since the vertical coordinates are integers, two bricks can overlap only when they are on the same row. A suitable predicate isPositive widths and nonnegative integer heights are the underlying domain conditions for a wall built on the baseplate. Distinct members of the set are compared even if their
Brick references happen to be identical: one brick specification can describe several placements. Testing object identity alone would miss two overlapping placements of the same specification. New to topics? Read the docs here!