For this source code, we use a Pascal set to represent the outcode, because this representation is more natural than an array of four booleans. We use an internal procedure to calculate the outcode for modularity; to improve performance, we would, of course, put this code in-line.