human
Elegant way to convert list to hex string
assistant
Here is some code to convert list of booleans `walls` into a hex string

hex(int(''.join([str(int(b)) for b in walls]), 2))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.