[docs]defset_secret_code(self)->None:pass# There is no code available for external game, skip it
[docs]defget_feedback(self,guess:tuple)->Union[tuple,str]:valid_feedback=ValidFeedback(number_of_dots=self.game_state.number_of_dots)whileTrue:feedback=input("Enter the feedback: ")iffeedback=="?":hint=f""" Enter a 2 digit number (optionally separated by comma) between 0 and {self.game_state.number_of_dots}. The first digit represents the number of black pegs, the second represents the number of white pegs. For example: 01 or 0,1 -> (0, 1) -> 0 black pegs, 1 white peg. Or, you can enter a command: (?) for help (d) to discard the game (q) to save and quit (u) to undo """print(hint)continueiffeedback=="d":print("Game discarded.")return"d"iffeedback=="q":# quitprint("Game saved.")return"q"iffeedback=="u":# undoreturn"u"try:valid_feedback.value=valid_feedback.validate_value(feedback)returnvalid_feedback.valueexcept(TypeValidationError,InputConversionError)ase:print(e)print("To get more help, enter '?'")exceptRangeError:print(f"Feedback must consist of 2 integer in range [0, {self.game_state.number_of_dots})")print("To get more help, enter '?'")