A code for enumerating cells in hyperplane arrangements