Parity magic programming exercises