Department numbers: Difference between revisions

→‎Zig using an iterator: Adjusted formatting
(→‎Zig using an iterator: Adjusted formatting)
Line 4,933:
}
}
 
</syntaxhighlight><syntaxhighlight lang="zig">
/// 3 bit unsigned (u3) limits 0 <= department <= 7
const Departments = packed struct {
Line 4,940:
fire: u3,
};
 
</syntaxhighlight><syntaxhighlight lang="zig">
const DepartmentsUnion = packed union {
departments: Departments,
together: u9,
};
 
</syntaxhighlight><syntaxhighlight lang="zig">
const SolutionIterator = struct {
// police initialized to zero as adding one is the first operation for next()
59

edits