this would be better as a boolean relying on an Xor to return boolean is not good practice IMHO So  move_dir = this->home_direction[c - 'X']^direction != 0 is better practice